Thread: tim
View Single Post
  #2 (permalink)  
Old 12-21-2007, 02:37 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,119
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon1

Alright, so assuming that content is the JPanel, here's what I usually do to create a JPanel that will be added to the JFrame. I don't think you should create JPanel as it's own class other than instantiate and set whatever variables within the JPanel as needed:

Code:
        JPanel content = new JPanel();
        content.setLayout(new BorderLayout(5, 5));
        content.add(changeColorBtn, BorderLayout.NORTH);
        content.add(left, BorderLayout.WEST);
        content.add(rite, BorderLayout.EAST);

/* .. somewhere later you need to add this JPanel named "content" to the JFrame e.g. add(buttonPanel, BorderLayout.CENTER); */
hope that helps!

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote