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

new JFrame in a Java Desktop Application

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use a JFrame here but instead a modal JDialog.
 
Shwetha Suresh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Shwetha Suresh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Marshal
Posts: 28298
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic