• Post Reply Bookmark Topic Watch Topic
  • New Topic

new JFrame in a Java Desktop Application

 
darshan sure
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on this Desktop Application that has several menu options. When the user clicks on one of the options another window has to appear and so I wrote another JFrame class with necessay functionality.

So when the menu option is selected I instantiate the JFrame class and set it visible. How do I make

a) this JFrame modal - I mean the actual application has to accessed through this JFrame only(either by hitting the 'continue' button on this JFrame or by hitting the 'cancel'
button)


b) also I do not want the minimize,maximize,close button to show up on this JFrame.


Any help is appreciated!
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use a JFrame here but instead a modal JDialog.
 
darshan sure
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for responding..

I chose to go with JFrame as I thought Dialog's were for alerting some form of messages/errors - (so I guess I was wrong on that)

or in other words where ever you need the "Modal" behavior from a window use Dialogs ?

 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
darshan sure wrote: I chose to go with JFrame as I thought Dialog's were for alerting some form of messages/errors - (so I guess I was wrong on that)

They're used for a lot of things, and can hold complete GUI's

or in other words where ever you need the "Modal" behavior from a window use Dialogs ?

Yes, and even for non-modal behavior.
 
darshan sure
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot pete stein for your response again.

My knowledge is limited would you suggest any books or links online that can help me make good decisions in future in such a situations.
I really do appreciate your help

 
Paul Clapham
Sheriff
Posts: 21882
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A google search with keywords "swing tutorial" should bring you to this page:

Swing Tutorial

In general if you want to find a tutorial about X then your google keywords should be "x tutorial" or "java x tutorial". In general read Sun tutorials in preference to others, but don't disregard the others either.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!