Results 1 to 4 of 4
Thread: TextField problem.
- 01-10-2011, 05:38 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
TextField problem.
Hi everyone,
what I wanted to achieve was a resizeable JTextField of width equal to a frame width. Successfully I did it, but I have some doubts about the another solution which unfortunately doesn't work.
I attached a print screen showing my code in two different versions and results.
I would be grateful for explanation.
Thanks in advance.
Bart
API says:
JPanel() - Creates a new JPanel with a double buffer and a flow layout.
JPanel(LayoutManager layout) - Create a new buffered JPanel with the specified layout manager
edit: My question is: Why in the first example the goal is achieved and in the second one a JTextField is squeezed in the middle?Last edited by miller.bartek; 01-10-2011 at 05:46 PM.
-
Please go into greater detail regarding your question. Thanks.
- 01-10-2011, 09:22 PM #3
Member
- Join Date
- Oct 2010
- Posts
- 63
- Rep Power
- 0
In the first example you use a Border Layout and in the second you use a Flow Layout.edit: My question is: Why in the first example the goal is achieved and in the second one a JTextField is squeezed in the middle?
Look up Layout Managers and how they work. They can be hard to understand without
experimenting.
- 01-11-2011, 06:06 PM #4
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
Similar Threads
-
Won't set to textfield
By Steffers in forum New To JavaReplies: 7Last Post: 11-04-2010, 02:32 PM -
1 question regarding textfield
By henry in forum New To JavaReplies: 3Last Post: 06-16-2010, 03:56 AM -
Textfield border problem
By jurka in forum AWT / SwingReplies: 2Last Post: 08-31-2008, 09:15 AM -
TextField Example
By Java Tip in forum SWTReplies: 0Last Post: 07-25-2008, 02:21 PM -
JSP - getting value from a textfield
By Java Tip in forum Java TipReplies: 0Last Post: 12-01-2007, 08:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks