File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Dynamic Jpanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dynamic Jpanel" Watch "Dynamic Jpanel" New topic
Author

Dynamic Jpanel

Tae Kim
Greenhorn

Joined: Apr 16, 2010
Posts: 5
OK I am taking the original post out and substituting it with this simpler problem. If you look at the code, you will see in the buildMainPanel() all I am trying to do is to create a new panel in the main container. But obciously there is this scope issue how can I get rid of this problem?

Tae Kim
Greenhorn

Joined: Apr 16, 2010
Posts: 5
Any takers ??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

PatienceIsAVirtue.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
pass a reference

//CollapsablePanel cp1 = new CollapsablePanel("Main Queue", buildMainPanel());
CollapsablePanel cp1 = new CollapsablePanel("Main Queue", buildMainPanel(contentPane));

//public static JPanel buildMainPanel() {
public static JPanel buildMainPanel(final Container contentPane) {
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Jpanel
 
Similar Threads
JButton with ImageIcon Size Problem
Expand/Collapse Panels
: A gray color box appeare d when loading an image on JPanel
Won't Display
How to make an 'expandable' button-like component