• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField  RSS feed

 
Franklyn Simon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I added a JTextField and a JLabel to a Box container and then the Box container to JFrame. The syntax of the text box is JTextField field =new JTextField(20).

However, the field took the rest of the Box space. Any help. Thanks.
 
Daniel Hirning
Ranch Hand
Posts: 50
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Franklyn, that is correct.

Take a look at the java tutorial on BoxLayout, it should explain it's behavior. Look at Box Layout Features specifically?
 
Randall Twede
Ranch Hand
Posts: 4690
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read about the other layouts also. they do no all behave that way. some make it only as big as necessary.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!