• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to use setBounds() method??

 
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am not using any layout, but, instead using setBounds method. is there any restriction with setBounds method. See the following code.



what should i provide in contentpane(marked '*')? and how will setBound work?
 
Sheriff
Posts: 22851
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to add "jf.add(jl)" or call "jf.getContentPane().add(jl)" (these two actually do the same). However, the call to setBounds will still be ignored. That's because the direct parent of L, jl, still has a LayoutManager that will reposition L.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so, how can i use setBounds in this example?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> so, how can i use setBounds in this example?

how would anyone exist without the internet?

http://download.oracle.com/javase/tutorial/uiswing/layout/none.html

the smart ones would resort to reading.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the above codings, how can i use dispose() method? I want that, if the user is AUTHORIZED, a new window named 'menuoptions' opens.. and previous window("login") is removed automatically.. i have removed the dispose method with comment in the coding provided above
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the above codings, how can i use dispose() method? I want that, if the user is AUTHORIZED, a new window named 'menuoptions' opens.. and previous window("login") is removed automatically.. i have removed the dispose method with comment in the coding provided above
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the simple answer in an applet is to use a CardLayout
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic