Results 1 to 5 of 5
- 01-11-2011, 09:13 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 57
- Rep Power
- 0
- 01-11-2011, 08:15 PM #2
Member
- Join Date
- Oct 2010
- Posts
- 63
- Rep Power
- 0
You have to use the right layout manager.
- 01-11-2011, 09:34 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
As hosscomp said, you have to use appropriate layout.
There are many solutions, but I will suggest you one of them.
You can use FlowLayout.CENTER
Whenever you create a JPanel using No-Argument Constructor
JPanel p = new JPanel();
it uses by default FlowLayout.CENTER .
Adding any component to this panel will center it, and while resizing it will also stay in the middle.
Look:
- 01-13-2011, 06:25 AM #4
Set a GridBagLayout and add the inner panel without a constraint.
db
- 01-18-2011, 08:22 AM #5
Member
- Join Date
- Dec 2010
- Posts
- 57
- Rep Power
- 0
Similar Threads
-
Java slave Frame access to its owner main frame problem
By cagdaseckin in forum New To JavaReplies: 0Last Post: 12-10-2010, 10:40 AM -
GUI based java program where size of the frame increases
By koushikG in forum AWT / SwingReplies: 4Last Post: 11-12-2010, 04:25 AM -
Setting frame size to the size of an image
By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM -
Prob. with screen resolution and Frame size??
By SANDY_INDIA in forum AWT / SwingReplies: 1Last Post: 08-16-2008, 12:51 PM -
[SOLVED] How to set the frame size?
By impact in forum New To JavaReplies: 7Last Post: 05-02-2008, 11:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks