0
在此處介紹一下思維塊:我需要將圖像轉換爲JScrollPane。應該很容易,但我有點失落。將JScrollPane添加到JSplitPane
JSplitPane pane1;
pane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
new JLabel("hi"),
(new JLabel(new ImageIcon(image))));
在此處介紹一下思維塊:我需要將圖像轉換爲JScrollPane。應該很容易,但我有點失落。將JScrollPane添加到JSplitPane
JSplitPane pane1;
pane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
new JLabel("hi"),
(new JLabel(new ImageIcon(image))));
你可以這樣做:
pane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JLabel("hi"),
(new JScrollPane(new JLabel(new ImageIcon(image)))));
非常感謝=] =] – Jay