Results 1 to 4 of 4
  1. #1
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Question How to set Modal to JFrame

    Hello All,

    How to set modal to jFrame?

    FrmSerial frmSerial = new FrmSerial();
    frmSerial.setDefaultCloseOperation(JFrame.HIDE_ON_ CLOSE);

    frmSerial.setVisible(true);

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default

    Hi, thanks, I tried below .. but still not working.. I need advise ..

    FrmSerial frmSerial = new FrmSerial();
    JDialog jd = new JDialog(frmSerial);
    jd.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    jd.setVisible(true);

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by newbiejava View Post
    Hi, thanks, I tried below .. but still not working.. I need advise ..

    FrmSerial frmSerial = new FrmSerial();
    JDialog jd = new JDialog(frmSerial);
    jd.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    jd.setVisible(true);
    Please have a look at the JDialog API, and it will tell you the proper constructor (or method) to use to set the dialog as a modal dialog. Happy coding!

Similar Threads

  1. How to make a modal JFrame?
    By surot in forum New To Java
    Replies: 20
    Last Post: 06-11-2011, 11:31 PM
  2. Replies: 3
    Last Post: 01-16-2010, 07:14 PM
  3. Extract Simulink modal data to Conqat Library
    By madarapu in forum Eclipse
    Replies: 0
    Last Post: 12-22-2009, 12:07 PM
  4. Replies: 4
    Last Post: 04-22-2009, 11:02 PM
  5. Can't edit JTextField after modal dialog
    By JavaNerd in forum Java Applets
    Replies: 0
    Last Post: 02-07-2008, 09:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •