Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with JPanel

Status
Not open for further replies.

tlohan

Programmer
Sep 14, 2001
19
BE
Hi,

I have an application in which there is a GUI that utilises the splitPane functionality. On the left side of this view there is a JTree which shows what 'Profile' has been loaded, initially this states 'No Profile'. On the right side there is a section which displays a JTable that is related to the loaded profile. Initially this JPane where the JTable is displayed is gray. Thus giving something like:

---------------------------------------------------
- No Profile |-------------------------------------
- |-------------------------------------
- |-------------------------------------
- |-------------------------------------

The following code is used to initialise this:

rightPanel.setLayout(cardLayout);
rightPanel.add("Blank", new JPanel());
for(int i = 0; i < profilePanels.length; ++i) {
rightPanel.add(profilePanels.toString(), profilePanels);
}

This works perfectly in Java1.2. However, recently I converted to Java1.3 and now find that on initialisation the JPanel does not appear. Even if I load in the JTable the Panel does not take on an ideal size. Instead it remains at the very right hand side and needs to be drag-and-dropped.

Why is this ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top