This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Resizing JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Resizing JTextField" Watch "Resizing JTextField" New topic

Resizing JTextField

zahid jamal

Joined: Oct 22, 2003
Posts: 1
Dear All,
I m making a desinger like available in JBuilder. I want to change the size of JTextField dynamically. I have done with drag and drop of the components (e.g: JLabel, JButton, etc). I still could not find any solution to resize the components during run time. Would anyone could help me to find out the solution. I want to increase or decrease the size of JTextField by clicking the mouse on the border of JTextField and draging with the mouse. This is like one does in JBuilder's designer. I would be grateful if anyone could provide me the code to perform the job.
warmly waiting..
[ October 22, 2003: Message edited by: zahid jamal ]

Zahid Jamal<br />System Analyst<br />Acrologix Pvt Ltd<br />Lahore, Pakistan.
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
I want to change the size of JTextField dynamically
From API:
public void setSize(Dimension d)
Resizes this component so that it has width d.width and height d.height.
This is hardly "Advanced Java", unless you are looking for something else.
It is sorta covered in the JavaRanch Style Guide.
subject: Resizing JTextField
Similar Threads
Developing JTextField which accepts only date
JTextArea Affecting Other Components
JTextField Action on Tab key
Having a hard time figuring out how to accomplish this in Swing
Resizing the JDialog when few fields are set invisible.