• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with GridBagLayout

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends.
I have a funny problem:

In a panel with GridBagLayout ,I have a JTextField witch has bean added to panel by this parameters :

myPanel.add(myJTextField, new GridBagConstraints(2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 0, 5), 1, 0));

It's set to be resized Horizontally when the form resizes! The problem is when the user types in this text field and reaches the end of in (Visualy I mean ) the myJTextField resizes itself to a bigger size !!!

what should I do to prevent this ? and I don't want to use setMax.... and such methods. I want it to be resized only when the panel resizes , not when the user types in it!!! ....

Thanks
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Kevin Onik
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks man !!! BUt the problem has changed!
Your code and mine are fine with default look and feel ! but ....
When I use Alloy lookAndFeel the problem arises as I mentioned before!

How cold this happen???
Test the code above with Alloy lookAndFeel !?!?!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic