Results 1 to 3 of 3
Thread: Working with Labels on Panels.
- 01-03-2008, 05:03 PM #1Member
- Join Date
- Jan 2008
- Rep Power
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);
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)
- 01-03-2008, 05:11 PM #2
The API also makes a note of the WEST and EAST attributes, maybe this will be the answer to your first question?
- 01-04-2008, 04:09 AM #3
- By jamesfrize in forum Java AppletsReplies: 3Last Post: 03-20-2008, 04:35 PM
- By Lehane_9 in forum AWT / SwingReplies: 1Last Post: 03-06-2008, 04:22 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 01-02-2008, 06:26 PM
- By plodos in forum New To JavaReplies: 2Last Post: 12-10-2007, 08:02 AM
- By ramachandran in forum New To JavaReplies: 1Last Post: 10-25-2007, 09:05 AM