View Single Post
  #1 (permalink)  
Old 01-03-2008, 07:03 PM
vargihate vargihate is offline
Member
 
Join Date: Jan 2008
Posts: 1
vargihate is on a distinguished road
Working with Labels on Panels.
Hi, I’m new here and I have 2 questions.

1) I have added some labels into a panel and by default they all align in the center of the screen. How do I align them all to the left?
I have tried using the following but nothing works:

label = new JLabel(“text”, SwingConstants.LEFT);
and
label.setVerticalTextPosition(JLabel.LEFT);
label.setHorizontalTextPosition(JLabel.LEFT);


2) I have one panel that contains 2 buttons and works like a main menu.
If the user clicks on a button a new panel must appear BELOW the panel of the main menu (I have lots of space below). However, the panel appears behind the main menu and therefore cannon be seen unless I set the visibility of the main menu to false.
Anyone knows how to show the panel below the first one? (so that I will always have the main menu visible)

Thanks,
Samantha!
Reply With Quote
Sponsored Links