Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GridBagLayout resizing is making component invisible  RSS feed

 
John Danek
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm working on an app that has a JSplitPane. The right pane of the JSplitPane is a GridBagLayout ( I didn't choose it, the previous developers did). In it is a JTextField that is approx 10 characters wide.

*Problem* If I make the GridBagLayout pane larger, everything works fine. But if I shrink it by setting the JSplitPane divider to halfway, the text field completely disappears, even though there is obviously more space to the right of it. I've set the JTextField's gridwidth to be the maximum possible, but it still disappears. Any suggestions???
 
John Danek
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found a fix. By reducing the gridwidth, and changing the anchor to EAST, it now behaves properly. It was WEST previously.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!