2012-11-19 129 views
0

在此處介紹一下思維塊:我需要將圖像轉換爲JScrollPane。應該很容易,但我有點失落。將JScrollPane添加到JSplitPane

JSplitPane pane1; 

pane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
    new JLabel("hi"), 
    (new JLabel(new ImageIcon(image)))); 

回答

5

你可以這樣做:

pane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JLabel("hi"), 
      (new JScrollPane(new JLabel(new ImageIcon(image))))); 
+0

非常感謝=] =] – Jay