Results 1 to 6 of 6

Thread: How to Call a JDialog from a JInternalFrame?

  1. #1
    Join Date
    Jan 2009
    Posts
    66

    How to Call a JDialog from a JInternalFrame?

    Hello, I have recently started to study the java and now I ma creating one program regarding it. But, I don't know how can I call a JDilaog from a JInternalFrame? If ayone knows the details about it, then please provide me solution about it.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to Call a JDialog from a JInternalFrame?

    If you want to call a JDialog from a JInternalFrame then you need to pass the JInternalFrame object to the constructor. First thing you would need to use the method of JOptionPane which is getFrameForComponent with the JInternalFrame. It will provide you required frame to use with your dialog. Then it is needed to provide the location for JDialog. For this purpose you can also make use of the setLocationRelativeTo (myInternalFrame) method. And there is also availability of the setLocationRelativeTo(null) for setting the JDialog to the center.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: How to Call a JDialog from a JInternalFrame?

    I think the code below can be useful for calling a JDialog from a JInternalFrame:
    Code:
    In JInternal frm
    {
    mdldlg = new mdldlg(internalframe,true)
    }
    
    In mdldlg extends JDialog {
    mdldlg(JFrame Jfrm , boolean modal)
    super(Jfrm, modal)
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to Call a JDialog from a JInternalFrame?

    You can use any one of the book to find out the solution :
    1. The Java Handbook
    2. Java in a Nutshell: A Desktop Quick Reference for Java Programmers
    3. The Java AWT Reference
    4. Thinking in Java
    5. Java Programming Language, 2nd Edition
    6. Core Java 1.2: Volume 1 Fundamentals

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: How to Call a JDialog from a JInternalFrame?

    You need to visit different java web sites for getting knowledge about the Java. I think that you need to visit the sun website for getting better solution to know about the JDialog. So, just visit it and you may be able to get the solution as well as more advanced knowledge about it. You can also get to know about it by reading different online tutorials.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to Call a JDialog from a JInternalFrame?

    Make use of the methods below to call a JDialog from a JInternalFrame:
    1. JOptionPane.getFrameForComponent
    2. setLocationRelativeTo(myInternalFrame)
    3. setLocationRelativeTo(null)

Similar Threads

  1. Replies: 14
    Last Post: 09-04-2012, 02:49 PM
  2. How to use JDialog class?
    By Mithun Seth in forum Software Development
    Replies: 5
    Last Post: 17-02-2010, 12:54 PM
  3. Confused with JInternalFrame class
    By Truster in forum Software Development
    Replies: 5
    Last Post: 17-02-2010, 09:58 AM
  4. JInternalFrame.JDesktopIcon class
    By Bottlenecked in forum Software Development
    Replies: 4
    Last Post: 17-02-2010, 09:24 AM
  5. Remove The Title Bar Of A JDialog
    By ramsun in forum Software Development
    Replies: 5
    Last Post: 27-01-2010, 01:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,261,011.69159 seconds with 17 queries