Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Swing / AWT / SWT
How do I add Text fields on seperate lines
Jere Johnson
Greenhorn
Posts: 28
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello,
How do i add text fields so that they dont look so cramped?
I want them on seperate lines....
code:
public void init () { Label title1, title2, title3, title4; c = new CheckboxGroup (); title1 = new Label ("Check for option: "); add (title1); miles = new Checkbox ("Miles", c, false); add (miles); miles.addItemListener(this); kilometers = new Checkbox ("Kilometers", c, false); add (kilometers); kilometers.addItemListener(this); title2 = new Label ("Enter distance traveled: "); add (title2); distanceField = new TextField (15); add (distanceField); distanceField.addActionListener (this); title3 = new Label ("Enter the time it took: "); add (title3); hoursField = new TextField (10); add (hoursField); hoursField.addActionListener (this); minutesField = new TextField (10); add (minutesField); minutesField.addActionListener (this); secondsField = new TextField (10); add (secondsField); secondsField.addActionListener (this); calculate = new Button ("Calculate"); startOver = new Button ("Start Over"); add (calculate); add (startOver); }
Diapers are the best invention
Gayathri Prasad
Ranch Hand
Posts: 116
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Do u know how to use lay out managers ? Use lay out managers to get the required format of UI.
Cheers,
Gaya3
Dirk Schreckmann
Sheriff
Posts: 7023
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Moving this to the Swing / JFC / AWT forum...
[
How To Ask Good Questions
] [
JavaRanch FAQ Wiki
] [
JavaRanch Radio
]
Paul Stevens
Ranch Hand
Posts: 2823
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Your code doesn't show what you are adding them to. What layout etc.
Here is an
example
to look at.
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
GUI
Need HELP Temperature Conversion
Multiple controls in a panel
Security Errors
Insurance Quote Applet
More...