ScrollPane doesn't work, why ??
From: javaSwing (frank.198233_at_gmail.com)
Date: 02/28/05
- Previous message: arvind via JavaKB.com: "Re: Access"
- Next in thread: javaSwing: "Re: ScrollPane doesn't work, why ??"
- Reply: javaSwing: "Re: ScrollPane doesn't work, why ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Feb 2005 23:26:19 -0800
code snippet below
class AA extends JPanel {
public void paintComponent(Graphics g) {
g.setColor(Color.yellow);
g.fillRect(0, 0, 200, 200);
}
}
public class B {
public static void main(String[] args) {
JFrame f = new JFrame();
AA apanel = new AA();
apanel.setPreferredSize(new Dimension(100, 100));
// it seems scrollpane didnt work
JScrollPane js = new JScrollPane(apanel);
f.getContentPane().add(js);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
look at the jscrollpane, how to make it work in this situation ??
- Previous message: arvind via JavaKB.com: "Re: Access"
- Next in thread: javaSwing: "Re: ScrollPane doesn't work, why ??"
- Reply: javaSwing: "Re: ScrollPane doesn't work, why ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|