Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

beginner question on swing component size  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is humbling to ask such a basic question but i will. say i have a fairly large frame. i add a JComboBox to "North". well it takes up the whole width of the frame. how do i make it only as big as necessary and align it to either the left or right?
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a nested JPanel with a FlowLayout. You can give this FlowLayout the alignment you want.
 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks again Rob
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Randall,
Tried MigLayout yet?
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall Twede wrote:thanks again Rob

You're welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!