Raymond Poon

Greenhorn
+ Follow
since Feb 22, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Raymond Poon

Depending on which tab is clicked in the JTabbedPane, a corresponding panel will be created.
I have created a simple test program as follows.


Currently all the source code are in the same file.
I like to extract all the panel codes and put them in their own files like the following files.
How to do that?
Is this the correct approach or something should be done in ChangeListener?
Panel1.java



JTabbedPane_Panel.java


13 years ago

Rob Camick wrote:Check out the solution in this posting for creating the button panel:

https://coderanch.com/t/528119/GUI/java/Position-buttons-GridBagConstraints-Swing



Using a horizontal BoxLayout solves the problem.
Thanks!
13 years ago
Another question is:
Executing setMinimumSize do not set the panel to a minimum size - the panel can be reduced to a very small size.
13 years ago
The right hand side of the last button of this program does not align horizontally with other components (e.g. JTextField).
How to make the right hand side of the last button ("b4") align horizontally with other components ?

13 years ago