Jdialog from JDialog

Hello guys,
I apologize for those that read many posts. I posted a question on the Swing Forum and haven't gotten much of a respond. My generally feeling is that my question is too basic for anyone to take the time to answer.
How does one open a JDialog from a JDialog?
I created and added the JButton the parent JDialog.
When I click on the "show" button I want it to launch another JDialog with a JScrollPane.
Thanks

hi,
well you could just use the setVisible(true) method in the actionListener for the button. Suppose there are 2 JDialogs jd1 and jd2. jd1 has a button, using the buttons actionListener, actionPerformed method, you could write something like:
jd2 obj = new jd2();
jd2.setVisible(true);this will pop open the second dialog. so just make 2 classes, one for each dialog and use something like the above to show the second one from the first one.

Similar Messages

  • Swing problem: table is not refreshed when i open it  from jdialog

    Hi , my situation is this one :
    1. i have a swing form.
    2. i have created a panel form where i have a drop down list and a table. wich are depndend with each other. When i choose an item to the drop down list the value in the table is changed.
    3. i invoke this panel into the form with drag and drop, with invoke jDialog from button option.
    4. First time i run the form and open the panel from button the drop down list and the table are working correctly.
    5. i close the panel and open it again: And at this time when i choose an item from drop down list the table is not refreshed anymore. I have to run the form again if i want that this panel to work correctly.
    Am i doing smth wrong? I dont have too much experience in swing , and the documentation for adf-swign are really poor .
    Ps: Maybe i should explain the way i have created the drop down list and table in the panel . i am not using smth like execute with parameters for the view in the table. I have created a link between the view in the drop down list and the view in the table. It seems they work correcly if i run the panel for the first time.
    Thanks in advance !

    To answer your question, Restore the iPhone with current iTunes on your computer. If fixed, it was software. If still problem, most likely hardware, and then make Genius reservation or set up Service and take or send to Apple for resolution under Warranty.

  • Creating JFrame from JDialog

    Hi ..
    I want to create a Frame from JDialog . But I am facig the problem the focus doesn't shift from dialog to this new frame which I created from this Dialog.
    Any ref. and approach ....plz do let me know.

    post the code here

  • Calling JDialog from JPanel

    Hi there, I will try to make this problem simple to understand,
    I have a Jframe which makes use of Jpanels, in a seperate file I have made an extension of a Jpanel which has buttons and when one of these buttons is pressed I want to call up a JDialog from another seperate file. The problem is in the call up where I need the parent frame but I do not have it in the JPanel class i've created (hense this wouldnt work). Any ideas or is there an easier solution to this, I've searched the forum and I cannot find any suitable answers to this (or at least any i can understand)
    Thank you for your time

    Hi!
    One way is to create a new JFrame as parent... it isn't right but it works....
    In constructor call super(new JFrame(), "Dialog Title")Another one could be to send the reference from main frame to the dialog and use as owner frame...
    /Andrew

  • Executing a JDialog  from another JDialog

    Hi,
    Is there a way to popup a JDialog from another JDialog and then close the first one.
    I have a button in a Jdialog that I want to open another Jdialog when the user click on it.
    The only way I could think of is to write a code that start another JDialog and close the first one.
    ----kirk

    In the Action performed function you can dispose or hide the first dialog and can bring up the second dialog.
    public void action performed(ActionEvent e)
    //button event
    this.dispose();
    SecondDialog dialog = new SecondDialog();
    dialog.show();
    }

  • Value from JDialog to another class

    Hi:
    I have a trouble with getting my values from a JDialog box to another class.
    Here's what I have:
    This is an ftp application. I have a main frame where if the user selects File->New Connection
    it pops up a Connect dialog box. The connect dialog box has various fields such as profile name, host address, user name, and so on. In addition, there are three buttons, Add, Connect and Cancel.
    After the user types info and clicks Connect, all these information should be sent to the main frame from where it would send the information to another class which would connect to the ftp server.
    I have a class called Profile which is used to wrap these information to be sent to the main frame.
    Now, how can i get this info to the main frame? Here's the code in main frame:
    class MainFrame extends JFrame {
    JMenuItem newconnection = new JMenuItem("New Connection", 'N');
    newconnection.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Profile p = new Profile();
    ConnectDialog con = new ConnectDialog();
    p = con.getProfile();
    makeNewConnection(p); //this is the method i use to make a new connection
    The problem is that by the time i get to the line p = con.getProfile(),
    con object no longer exists.
    Should i use threads or should i just send the main frame as the parameter to create the Connect dialog. If i use threads, how should i code it, and if i use main frame as the parent frame for connect dialog, how do i get the info to main frame. Please help. Here's the code for ConnectDialog. Also, please advice if ConnectDialog code can be improved since i am new to swing. Thanks for helping a needy student.
    public class ConnectDialog extends JDialog{
    private MainFrame parent;
    private String defaultDownloadPath;
    private static Profile currProfile;
    private JList profileList;
    private JPanel listPanel;
    private JPanel infoPanel;
    private JPanel labelPanel;
    private JPanel buttonPanel;
    private JPanel arrangedComponents;
    private Vector data;
    private JLabel ProfileName;
    private JLabel HostAddress;
    private JLabel Account;
    private JLabel PortNo;
    private JLabel login;
    private JLabel password;
    private JLabel DownLoadPath;
    private JButton addButton;
    private JButton cancelButton;
    private JButton connectButton;
    private JButton browseButton;
    private JButton clearButton;
    private JLabel Anonymous;
    private JCheckBox anonymous;
    private JTextField profileName;
    private JTextField hostAddress;
    private JTextField account;
    private JTextField portNo;
    private JTextField loginName;
    private JTextField passwd;
    private JTextField downloadPath;
    private final int textSize = 20;
    private final int fontSize = 12;
    private Container cp;
    public ConnectDialog(MainFrame main) {
    super(main, true);
    parent = main;
    data = new Vector();
    currProfile = new Profile();
    profileList = new JList(data);
    listPanel = new JPanel();
    labelPanel = new JPanel();
    infoPanel = new JPanel();
    buttonPanel = new JPanel();
    arrangedComponents = new JPanel();
    ProfileName = new JLabel("Profile Name:");
    ProfileName.setForeground(Color.black);
    HostAddress = new JLabel("Host Address:");
    HostAddress.setForeground(Color.black);
    Account = new JLabel("Account:");
    Account.setForeground(Color.black);
    PortNo = new JLabel("Port:");
    PortNo.setForeground(Color.black);
    login = new JLabel("Login:");
    login.setForeground(Color.black);
    password = new JLabel("Password:");
    password.setForeground(Color.black);
    DownLoadPath = new JLabel("Download Path:");
    DownLoadPath.setForeground(Color.black);
    addButton = new JButton("Add");
    addButton.setMnemonic('A');
    addButton.setForeground(Color.black);
    cancelButton = new JButton("Cancel");
    cancelButton.setForeground(Color.black);
    clearButton = new JButton("Clear");
    clearButton.setForeground(Color.black);
    connectButton = new JButton("Connect");
    connectButton.setForeground(Color.black);
    connectButton.setMnemonic('C');
    browseButton = new JButton("Browse");
    browseButton.setForeground(Color.black);
    browseButton.setMnemonic('B');
    Anonymous = new JLabel("Anonymous: ");
    Anonymous.setForeground(Color.black);
    anonymous = new JCheckBox();
    profileName = new JTextField(textSize);
    profileName.setText("");
    profileName.setBorder(BorderFactory.createLoweredBevelBorder());
    profileName.setBorder(BorderFactory.createLineBorder(Color.black));
    profileName.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    hostAddress = new JTextField(textSize);
    hostAddress.setText("");
    hostAddress.setBorder(BorderFactory.createEtchedBorder());
    hostAddress.setBorder(BorderFactory.createLineBorder(Color.black));
    hostAddress.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    account = new JTextField(textSize);
    account.setText("");
    account.setBorder(BorderFactory.createLoweredBevelBorder());
    account.setBorder(BorderFactory.createLineBorder(Color.black));
    account.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    portNo = new JTextField(5);
    portNo.setText("");
    portNo.setText("21");
    portNo.setBorder(BorderFactory.createEtchedBorder());
    portNo.setBorder(BorderFactory.createLineBorder(Color.black));
    portNo.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    loginName = new JTextField(textSize);
    loginName.setText("");
    loginName.setBorder(BorderFactory.createEtchedBorder());
    loginName.setBorder(BorderFactory.createLineBorder(Color.black));
    loginName.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    passwd = new JTextField(textSize);
    passwd.setText("");
    passwd.setBorder(BorderFactory.createEtchedBorder());
    passwd.setBorder(BorderFactory.createLineBorder(Color.black));
    passwd.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    downloadPath = new JTextField(textSize);
    downloadPath.setText("");
    downloadPath.setBorder(BorderFactory.createEtchedBorder());
    downloadPath.setBorder(BorderFactory.createLineBorder(Color.black));
    downloadPath.setFont(new Font("Dialog",Font.PLAIN,fontSize));
    cp = this.getContentPane();
    this.setBounds(200,200,600,300);
    this.setResizable(false);
    cp.setLayout(new BorderLayout());
    setListPanel();
    setLabelPanel();
    setButtonPanel();
    setActionListeners();
    this.setBackground(Color.lightGray);
    this.setVisible(true);
    this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    public String getDefaultDownloadPath() {
    return defaultDownloadPath;
    // public Profile getProfile() {
    // try {
    // this.wait();
    // } catch (Exception e) {}
    // return currProfile;
    public void setListPanel() {
    profileList.setFont(new Font("Dialog", Font.PLAIN, 12));
    profileList.setBackground(Color.white);
    profileList.setForeground(Color.black);
    profileList.setPrototypeCellValue("MMMMMMMMM");
    listPanel.setPreferredSize(profileList.getPreferredScrollableViewportSize());
    listPanel.setBorder(BorderFactory.createEtchedBorder());
    listPanel.setBorder(BorderFactory.createLineBorder(Color.black));
    listPanel.setBackground(Color.white);
    listPanel.add(profileList);
    cp.add(listPanel, "West");
    public void setLabelPanel() {
    arrangedComponents = new JPanel();
    arrangedComponents.setLayout(new BorderLayout());
    labelPanel = new JPanel();
    labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.Y_AXIS));
    labelPanel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
    JPanel row1 = new JPanel();
    row1.add(ProfileName);
    labelPanel.add(row1);
    JPanel row2 = new JPanel();
    row2.add(HostAddress);
    labelPanel.add(row2);
    JPanel row3 = new JPanel();
    row3.add(Account);
    labelPanel.add(row3);
    JPanel row4 = new JPanel();
    row4.add(PortNo);
    labelPanel.add(row4);
    JPanel row5 = new JPanel();
    row5.add(login);
    labelPanel.add(row5);
    JPanel row6 = new JPanel();
    row6.add(password);
    labelPanel.add(row6);
    JPanel row7 = new JPanel();
    row7.add(DownLoadPath);
    labelPanel.add(row7);
    infoPanel.setLayout(new BoxLayout(infoPanel,BoxLayout.Y_AXIS));
    infoPanel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
    row1 = new JPanel();
    row1.add(profileName);
    row1.add(profileName);
    infoPanel.add(row1);
    row2 = new JPanel();
    row2.add(hostAddress);
    row2.add(hostAddress);
    infoPanel.add(row2);
    row3 = new JPanel();
    row3.add(account);
    infoPanel.add(row3);
    row4 = new JPanel();
    row4.setLayout(new FlowLayout());
    row4.add(portNo);
    row4.add(Box.createHorizontalStrut(57));
    row4.add(Anonymous);
    row4.add(anonymous);
    infoPanel.add(row4);
    row5 = new JPanel();
    row5.add(loginName);
    infoPanel.add(row5);
    row6 = new JPanel();
    row6.add(passwd);
    infoPanel.add(row6);
    row7 = new JPanel();
    row7.setLayout(new FlowLayout());
    row7.add(downloadPath);
    row7.add(browseButton);
    infoPanel.add(row7);
    arrangedComponents.add(labelPanel, "West");
    arrangedComponents.add(infoPanel, "Center");
    cp.add(arrangedComponents, "Center");
    public void setButtonPanel() {
    buttonPanel.setLayout(new FlowLayout());
    buttonPanel.add(addButton);
    buttonPanel.add(connectButton);
    buttonPanel.add(cancelButton);
    buttonPanel.add(clearButton);
    cp.add(buttonPanel, "South");
    public void setActionListeners() {
    anonymous.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         if(anonymous.isSelected()) {
         loginName.setText("anonymous");
         passwd.setText("your email here");
         else {
         loginName.setText("");
         passwd.setText("");
    addButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         if(profileName.getText() != "" && !data.contains(profileName.getText())){
         data.add(profileName.getText());
         profileList.setListData(data);
    connectButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         connectButtonPressed();
    cancelButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         JButton b = (JButton) e.getSource();
         ConnectDialog c = (ConnectDialog) b.getTopLevelAncestor();
         c.dispose();
    clearButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         profileName.setText("");
         hostAddress.setText("");
         account.setText("");
         portNo.setText("");
         loginName.setText("");
         passwd.setText("");
         downloadPath.setText("");
    browseButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         JFrame browseFrame = new JFrame("browse for folder");
         browseFrame.setBounds(230,230,200,200);
         JDirectoryChooser fileChooser = new JDirectoryChooser();
         fileChooser.setFileSelectionMode(JDirectoryChooser.DIRECTORIES_ONLY);
         int option = fileChooser.showDialog(browseFrame);
         if(option==JFileChooser.APPROVE_OPTION) {
         File f = fileChooser.getSelectedFile();
         defaultDownloadPath = f.getAbsolutePath();
         downloadPath.setText(defaultDownloadPath);
    public void connectButtonPressed() {
    if(!profileName.getText().equals("") && !hostAddress.getText().equals("") &&
    !loginName.getText().equals("") && !passwd.getText().equals("")) {
    currProfile.setProfileName(profileName.getText());
    currProfile.setHostAddress(hostAddress.getText());
    currProfile.setAcct(account.getText());
    currProfile.setUserName(loginName.getText());
    currProfile.setPassword(passwd.getText());
    currProfile.setDownloadPath(downloadPath.getText());
    parent.setProfile(currProfile);
    this.dispose();
    else {
    JFrame f = new JFrame("Error!");
    JOptionPane.showMessageDialog(f, "Some fields empty!", "", JOptionPane.ERROR_MESSAGE);
    }

    If the dialog is modal then you can just call show and wait for it to close by the user, then grab the info:
    ConnectDialog dialog = new ConnectDialog();
    dialog .show();
    Profile profile = con.getProfile();
    makeNewConnection( profile );

  • GUI components not clearing from JDialog closing

    Greetings,
    I have developed an application which works on several different computers with several different JVMs, but which does not operate as anticipated on my (new) tablet PC. It leaves GUI components on the main JFrame from various Jdialog boxes (after closing them) that I throw at the user when the program starts.
    I also have a username/password prompt at the beginning which is another JFrame that doesn't appear correctly. The input areas do not appear with a white background and the Username and Password JLabels have echoed themselves into that area.
    I'm guessing this is Windows XP, Tablet Edition issue. I'd like to know if anyone else has experienced anything similar?
    FYI, this programs works quite well on Windows 98, Windows XP Home and Professtional, Windows 2000, and Windows ME.
    Any help would be most appreciated.
    Regards

    Hi all,
    I am trying to develop a Java application on the Tablet PC. I am new to this platform and could not find much information about Java related Tablet PC development .So I am posting this question here
    Details
    I have developed a Swing Application in Java (J2SDK 1.4.2) for a Client, which currently runs on Windows XP on the Standard Laptop. The application uses the following
    1) Menus
    2) Panels
    3) Dialogs
    It consists of an entry form, which is saved as an XML file on the user's computer. Also it uses an Access Database.
    The other thing that the application uses is a Signature Capture Device to capture a user's signature
    I would like to move this application to the Tablet PC.
    I have the following questions
    1) What SDK do I use for the Tablet PC? Also what version of Java web start and Run time?
    2) What kind of changes do I need to make in my application?
    3) Can I make use of the "Ink" feature, which is provided with a Tablet PC in Java?
    4) Where can I find user samples if any for Java Tablet PC development?
    BTW I am using Toshiba Prot�g� 3500 for my project.
    Thanks,
    Raja

  • How to get rid of "Java Applet Window"  from JDialog

    Hi Friends,
    I am developing an applet that uses JDialog class. I want to get rid of "Java Applet Window" that appears at the bottom of my JDialog.
    When I run my application from the web, I do not want that to show up.
    Is there any way of doing it ?
    Many thanks in advance.
    Ramesh

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%22Java+Applet+Window%22&col=javaforums&x=36&y=9

  • Problem displaying JDialog from a JApplet

    When I try to display a JDialog (of a JFrame) from a JApplet, the dialog is displayed but it never receives any paint events, so the form seems empty.
    Basically, this is what happens:
    A JPanel is added to the content pane of a JApplet.
    When that panel receives a mouse action event, a new window is created like this:
    TestWindow tw = new TestWindow();
    tw.setVisible();That's it. When the window is started from a method in the applet itself, however (init() for example) the window does display correctly.
    Can anyone tell me what might be going wrong?

    /*  <applet code="AppletDialog" width="300" height="180"></applet>
    *  use: >appletviewer AppletDialog.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class AppletDialog extends JApplet
        JDialog dialog;
        public void init()
            initDialog();
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(getNorthPanel(), "North");
            getContentPane().add(getSouthPanel(), "South");
        private void initDialog()
            JLabel label = new JLabel("dialog contents", JLabel.CENTER);
            dialog = new JDialog(new Frame(), false);
            dialog.getContentPane().add(label);
            dialog.setSize(200,100);
            dialog.setLocation(540,200);
        private JPanel getNorthPanel()
            JButton launch = new JButton("show dialog");
            launch.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    dialog.setTitle("from button");
                    dialog.setVisible(true);
            JPanel panel = new JPanel();
            panel.add(launch);
            return panel;
        private JPanel getSouthPanel()
            JPanel panel = new JPanel(new BorderLayout());
            panel.setBackground(Color.pink);
            panel.add(new JLabel("click here for dialog", JLabel.CENTER));
            Dimension d = panel.getPreferredSize();
            d.height = 45;
            panel.setPreferredSize(d);
            panel.addMouseListener(new MouseAdapter()
                public void mousePressed(MouseEvent e)
                    dialog.setTitle("from mouse");
                    dialog.setVisible(true);
            return panel;
        public static void main(String[] args)
            JApplet applet = new AppletDialog();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(applet);
            f.setSize(300,180);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    }

  • Headache: Data Xchange from JDialog to JTable using JButton

    My head is spinning about how to get this to work. What is really confusing me is the data exchange from the JDialog.
    I have a JTable where one of the columns uses a JButton as the cell editor for each cell in that column. That part seems to be no problem. The JButton is labeled "Define Staff..."
    When the user clicks on the JButton, a JDialog containing a JList is to appear. If the user clicks cancel, the JDialog is disposed and nothing happens. If the user clicks OK, the selected items are to be returned to the cell in some way and the label of the JButton is to change to "Modify Staff..."
    How can I return the list from the JDialog to the "cell" so that when I access the cell using getValueAt() I get the list of values, and not the JButton object?

    Thanks.
    The actual JButton is inside a JTable cell though.
    Where would I add the event handler for the button? In the editor? In the renderer?
    Excerpt from the JTable file:
         PositionTable.getColumn("Staff").setCellRenderer(new ButtonRenderer());
         PositionTable.getColumn("Staff").setCellEditor(new ButtonEditor(new JCheckBox()));ButtonEditor.java
    public class ButtonEditor extends DefaultCellEditor {
      protected JButton button;
      private String    label;
      private boolean   isPushed;
      public ButtonEditor(JCheckBox checkBox) {
        super(checkBox);
        button = new JButton();
        button.setOpaque(true);
        button.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fireEditingStopped();
      public Component getTableCellEditorComponent(JTable table, Object value,
                       boolean isSelected, int row, int column) {
        if (isSelected) {
        } else{
          button.setForeground(table.getForeground());
          button.setBackground(table.getBackground());
        label = (value ==null) ? "" : value.toString();
        isPushed = true;
        return button;
      public Vector<String> getCellEditorValue() {
        Vector<String> staff = new Vector<String>();
        if (isPushed)  {
          staffSelector temp = new staffSelector(null,true,"Building Supervisor");
          temp.setVisible(true);
          staff = temp.getSelectedStaff(true);
        isPushed = false;
       // return new String( label ) ;
       //Return vector people selected.
       return staff;
      public boolean stopCellEditing() {
        isPushed = false;
        return super.stopCellEditing();
      protected void fireEditingStopped() {
        super.fireEditingStopped();
    }ButtonRenderer.java
    public class ButtonRenderer extends JButton implements TableCellRenderer {
      public ButtonRenderer() {
        setOpaque(true);
      public Component getTableCellRendererComponent(JTable table, Object value,
                       boolean isSelected, boolean hasFocus, int row, int column) {
        if (isSelected) {
          setForeground(table.getForeground());
          setBackground(table.getBackground());
        } else{
          setForeground(table.getForeground());
          setBackground(UIManager.getColor("Button.background"));
        setText( (value ==null) ? "Define Staff..." : "Modify Staff..." );
        return this;
    }Message was edited by:
    AsymptoticCoder
    Made an error.

  • Multiple inputs from JDialog

    Hi, i want to create a dialog to get some inputs from users (like how many row and column they want for the table). I dont know how to get more than 1 input via JDialog. Please help me!!
    Thanks a lot.

    Here is an example - to give you an idea.
    JTextField keyField = new JTextField("");
    JTextField firstName = new JTextField("");
    JTextField middleName = new JTextField("");
    JTextField lastName = new JTextField("");
    Object[] options = {"OK","CANCEL"};
    Object[] msg = {"Please enter the new four digit NUMERIC employee ID", keyField, "Enter employee first name", firstName, "Enter employee middle name", middleName, "Enter employee last name", lastName};
    final JOptionPane op = new JOptionPane(msg, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION){};
    JDialog dialog = op.createDialog(splitPane, "Enter the new employee's information...");
    dialog.show();
    int result = JOptionPane.OK_OPTION;
    try {result = ((Integer)op.getValue()).intValue();}
    catch(Exception uninitializedValue){}
    if(result == JOptionPane.OK_OPTION) {
      String empID = keyField.getText();
      String empFirst = firstName.getText().trim();
      String empMiddle = middleName.getText().trim();
      String empLast = lastName.getText().trim();
      if(!empID.equals("")) {
        // got data do whatever
    else {
      // user cancelled
    }rykk

  • Open a JDialog from an JApplet

    Hello,
    I have an applet and I want to open a separate window. The problem is that I want this window to be modal, and therefore I have to use a JDialog, but a JDialog needs an owner that can only be a JFrame or a JDialog, so I cannot use the JApplet as an owner. I tried to set the owner to null, but then if the user changes the focus to another window in his/her OS, and then returns to the browser, the JDialog does not reappear, so the applet is stuck!
    Does anybody have an idea how I can solve this problem?
    Thanks very much.

    Yes, cuz all applets have a frame....
    Frame f =
    (Frame)SwingUtilities.getAncestorOfClass(Frame.class,
    this);Thank you very much. I will try this solution.

  • Calling a Jdialog from javascript using bean in JSP

    Hello all...
    In my jsp page , I have a button , onclicking it a javascript is called and in that javascript a bean is called to show a JDialog window. In that Jdialog window , I have a JTable, Accept button and Cancel Button..
    But the JavaScript is not calling bean...
    sample code :
    <input type ="submit" name="submit" onclick="func()">
    <script language ="javascript">
    func(){
    beanid.fn();
    </script>
    and in MyClass.fn(){
    codes for display is written......
    Is there anything wrong in this approach or if any other solution will to my needs please let me know..
    Regards
    SunilrKP

    Where is the JavaBean? Are you using an (J)Applet to deploy the bean to the client? If so then you might want to hop on over to the [Applet Forum|http://forums.sun.com/forum.jspa?forumID=421] to see what the problem is. When you do, show them the JavaScript you use to access the Applet.
    If you are not deploying the JavaBean via an Applet, then the class lives on the Server, while JavaScript lives on the Client - two different machines separated by space and time. You will need to change your approach (ie deploy the bean via an Applet or don't stop trying to use Swing as display over HTTP).

  • How to access JFrame poppued up from JDialog

    Hi All,
    I have a JDialog(modal) with a Jbutton.If i click the button then a JFrame opens.Now as JDialog is setModal(true) im unable to acces the JFrame .Can u pls let mne know the way to handle this issue .I have a seroius issue with it.Kindly help me out....
    cheers,
    sharath

    Oh, and, dispose the non-modal db in button's listener method ...
    ... if it is your requirement ...

  • How to avoid other applications from showing when JDialog is running?

    Hi to all,
    I need to get JDialog from JFrame when a button is pressed in my application.
    Im getting JDialog fine but what my problem is,
    When JDialog appears on the screen at the back it is showing windows application which is already opened..
    My JFrame hides at that time.
    How to make it display on JFrame only...
    Can anyone help me out.
    Thanks in advance.

    Specify the JFrame as the owner of the JDialog. Read the JDialog API for the different constructors you can use.

Maybe you are looking for