![]() |
Putting spaces between formatted text fields
:
package components;(To avoid reading all of this code, read my post below this one -- I think it will be sufficient to answer the question and it is much less code. But just in case it isn't, I've posted the whole program) |
Re: Putting spaces between formatted text fields
In particular, this code (from what I posted above) lays out my text fields into a panel.
:
I want to add whitespace between: teamField2 and teamField3; teamField4 and teamField5. But I also want the word "vs." to be clearly associated with each pair (i.e., sufficiently inbetween 1 & 2, 3 & 4, and 5 & 6). I hope that makes sense. |
Re: Putting spaces between formatted text fields
you have lots of repeted code. consider using an array list to hold all the textfileds and making a method that creats all the text fields and adds the action listerns to the text fields. you still have to manual creat each text feild
genTextfeild(new JTextField(""));why did you did you extend jpanel and not jframe? |
Re: Putting spaces between formatted text fields
There's no repeated code. There are two containers, one to hold labels, and one to hold text fields. This ensures that they are aligned properly. The only unnecessary code is setUpFormats() and the code that creates formats, but I will need it later so I left it there. And you didn't answer the question.
|
Re: Putting spaces between formatted text fields
No one else? Just letting anyone who reads know I'm around and will read replies. There's probably an easy solution that I haven't thought of. Thanks for any replies.
|
Re: Putting spaces between formatted text fields
yah know you can put vertical spacing for GridLayout.... and use panels for group of two texfeilds
|
Re: Putting spaces between formatted text fields
thats what I already did, as far as I remember. Haven't looked at it lately though. But that will probably do it. I think I'll just add a label thats just a blank string to space it.
|
Re: Putting spaces between formatted text fields
Quote:
JPanel labelPane = new JPanel(new GridLayout(0,1));http://java.sun.com/javase/6/docs/ap...,%20int,%20int |
| All times are GMT -5. The time now is 3:58 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC