Re: Hiding a JTexfield from the GUI



jgricourt@xxxxxxx wrote:
Hi,

I'd like to hide a JTextField from the GUI so that the layout doesn't
"see it" anymore ? I tried, setVisible(false) but it leaves an empty
space on the layout as if the component was still there.

Is there an easy way to achieve this ?

Use a different layout manager. Some layout managers will collapse invisible components.

Have you tried resetting the components minimum,maximum,preferred sizes?

Have you called the container's pack()?

Which layout manager are you using?

Have you read http://sscce.org/ ?

--
RGB
.



Relevant Pages

  • Re: easy dialog resizing
    ... The layout controls in Whidbey are a bit better, ... > "Justin Rogers" wrote in message ... >> the layout manager to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: suitable layout manager?
    ... what layout manager is the ...
    (comp.lang.java.gui)
  • Re: how to set (preferred) JSlider length?
    ... To set size of your component and still work with a layout manager: ... public void init() { ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.programmer)
  • Re: GetKeyState() problem
    ... especially for the toggle keys. ... > No, no layout manager stuff. ... >> input system's understanding of these modifier flags. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: once again, another dumb noob question
    ... layout manager that will meet my design needs for the GUI. ... You the logic to layout the GUI, ...
    (comp.lang.java.help)