Results 1 to 2 of 2
-
Trouble adding JPanel to JFrame with NetBeans IDE
Hi, I've designed some JFrame forms in netbeans which I intended to add to the main JFrame. Then I realised thats not possible so I created a new JPanel form and then copy+pasted the contents and source code of the minor JFrame form to the JPanel form.
Now I need to add the JPanel form to the main JFrame but whatever I've tried won't get the JPanel to display... Please tell me what I am doing wrong?
I tried this way:
//productsPanel is a JPanel in the main JFrame
productsPanel.add(new ProductsViewer());
I also tried this:
ProductsViewer myProductsViewer = new ProductsViewer();
productsPanel.add(myProductsViewer);
myProductsViewer.setVisible(true);
And I also tried to use these two methods after adding the JPanel to the JFrame:
productsPanel.validate();
productsPanel.repaint();
Nothing seems to get this JPanel to show.
Please help!!
Thanks
- 05-23-2011, 11:35 PM #2
Similar Threads
-
Adding JButton to JPanel
By razmyasdfg in forum AWT / SwingReplies: 8Last Post: 05-24-2011, 12:03 AM -
Adding a jpanel to a customized Jpanel Class
By trishtren in forum AWT / SwingReplies: 7Last Post: 04-05-2011, 07:52 PM -
Adding Jpanel ontop of another Jpanel
By Manfizy in forum AWT / SwingReplies: 4Last Post: 03-05-2011, 11:34 PM -
adding integer to the JPanel
By navid in forum New To JavaReplies: 2Last Post: 12-18-2010, 05:26 PM -
I am having trouble with scrollbars in netbeans 5.5.1
By ineedhelp in forum New To JavaReplies: 2Last Post: 03-13-2009, 07:56 PM
Bookmarks