Package javax.swing

Examples of javax.swing.JDialog


        model.addPage("test1", new JLabel("Ronan 1"));
        model.addPage("test2", new JComboBox());
        model.setSelectedPage("test2");

        JDialog test = new JDialog();
        test.getContentPane().add(new StackPanel(model));

        test.setModal(true);
        test.pack();
        test.setVisible(true);
       
        System.exit(0);
    }
View Full Code Here


      ActionListener okListener = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          colorEditor.currentColor = colorChooser.getColor();
        }
      };
      final JDialog dialog = JColorChooser.createDialog(button,
                      resources.getString("PickAColor"),
                      true,
                      colorChooser,
                      okListener,
                      null); //XXXDoublecheck this is OK

      //Here's the code that brings up the dialog.
      button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          button.setBackground(colorEditor.currentColor);
          colorChooser.setColor(colorEditor.currentColor);
          //Without the following line, the dialog comes up
          //in the middle of the screen.
          dialog.setLocationRelativeTo(button);
          dialog.show();
        }
      });
    }
View Full Code Here

                return;
            }
            if (o instanceof DataSource) {
                try {
                    DataSourceInformationDialog di = new DataSourceInformationDialog((DataSource) o);
                    JDialog jd = di.createDialog(JSynoptic.gui.getOwner());
                    if (jd != null) {
                        jd.setVisible(true);
                    }
                } catch (DataException ee) {
                    JSynoptic.setStatus(ee.getMessage());
                }
                return;
View Full Code Here

                list.setVisibleRowCount(10);
                JPanel bbox = new JPanel(new FlowLayout());
                final JButton bok;
                bbox.add(bok = new JButton("OK"));
                // bbox.add(bcancel = new JButton("Cancel"));
                final JDialog dialog = new JDialog(JSynoptic.gui.getOwner(), resources
                        .getString("conflictResolutionDialog"), true);
                dialog.getContentPane().add(pane, BorderLayout.CENTER);
                dialog.getContentPane().add(bbox, BorderLayout.SOUTH);
                bok.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        conflictsOK = true;
                        dialog.setVisible(false);
                    }
                });
                /*
                 * bcancel.addActionListener(new ActionListener() { public void
                 * actionPerformed(ActionEvent e) { conflictsOK = false;
                 * dialog.hide(); } });
                 */
                changeSourceAlias.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        Object o = st.getSelectedSourceOrCollection();
                        if (!(o instanceof DataSource)) {
                            return;
                        }
                        VariableConflict vc = (VariableConflict) list.getSelectedValue();
                        ((DataSource) o).getInformation().alias = vc.var;
                        list.repaint();
                        if (clm.resolved()) {
                            bok.setEnabled(true);
                        }
                        TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                        ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                    }
                });
                st.addTreeSelectionListener(new TreeSelectionListener() {
                    public void valueChanged(TreeSelectionEvent e) {
                        Object o = st.getSelectedSourceOrCollection();
                        if ((o instanceof DataSource) && e.isAddedPath()) {
                            VariableConflict vc = (VariableConflict) list.getSelectedValue();
                            vc.ds = (DataSource) o;
                            list.repaint();
                            if (clm.resolved()) {
                                bok.setEnabled(true);
                            }
                            TreeNode tn = (TreeNode) (st.getSelectionPath().getLastPathComponent());
                            ((DefaultTreeModel) (st.getModel())).nodeChanged(tn);
                        }
                    }
                });
                list.addListSelectionListener(new ListSelectionListener() {
                    public void valueChanged(ListSelectionEvent e) {
                        Object sel = list.getSelectedValue();
                        if (sel == null) {
                            return;
                        }
                        st.setSelectedValue(((VariableConflict) sel).ds); // call
                        // the
                        // tree
                        // selection
                        // listener
                        // in
                        // turn
                    }
                });
                list.setSelectedIndex(0);
                bok.setEnabled(false);
                dialog.pack();
                dialog.setVisible(true);
                if (!conflictsOK) {
                    return null; // cancel => do not create the source
                }
            }
        }
View Full Code Here

            bBaseColor.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {

                    DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            NodeResourcesManager.resources.getString("SelectAColor"),
                            null,baseColor,baseColorMapperSource,baseColorMapper);

                    dialog.pack();
                    dialog.setVisible(true);

                    if (dialog.isOk()){
                        baseColor = dialog.getColor();
                        bBaseColor.setBackground(baseColor);
                        DataSource baseColorTempDataSource = dialog.getSource();
                        baseColorMapper = dialog.getMapper();

                        if  (baseColorTempDataSource!=null){

                            if (baseColorMapperSource!=null)
                                baseColorMapperSource.removeEndNotificationListener(ShapeNode.this);

                            baseColorMapperSource  = baseColorTempDataSource;
                            baseColorMapperSource.addEndNotificationListener(ShapeNode.this);  
                        }

                    }
                }
      });
           
           
            bHighlightColor.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
         
                    DynamicColorChooser dialog = new DynamicColorChooser(
                            new JDialog(),
                            NodeResourcesManager.resources.getString("SelectAColor"),
                            null,highlightColor,highlightColorMapperSource,highlightColorMapper);
                   

                    if (dialog.isOk()){
View Full Code Here

  public JDialog createDialog(Frame parent) {
   
    if (dialog!=null){
      return null
    }
    dialog = new JDialog( parent, resources.getString("plotInformation"), false);
    Container contentPane = dialog.getContentPane();

    JTabbedPane informationPane = new JTabbedPane();
   
      // Hearder panel
View Full Code Here

    public void doAction(Object action) {
        if (action==null) return;
        if (action.equals(NodeResourcesManager.resources.getString("Properties"))) {
          PropertiesTransformDataUI dui = new PropertiesTransformDataUI(this, data, properties, true, colorMapperManager);
            JDialog dialog = dui.createDialog(null, NodeResourcesManager.resources.getString("Properties"));
            dialog.show();
        }
    }
View Full Code Here

      }
      tabPane.insertTab(name, null, c, null, tabIndex);
      elements.add(index, createElement(c, name, tabPane,null));
    }
    else if(mode==DETACHED){
      JDialog jd=createDialog(c,name);
      elements.add(index, createElement(c, name, jd,null));
    }
  }
View Full Code Here

      topBox.add(dimensionsPanel);

      content.add(topBox);

      box = Box.createHorizontalBox();
      JPanel panel = mapperCopy.createPanel(new JDialog(),null)// TODO refactoring on Automaton shape, do like
      // all other builtin shapes !
      panel.setBorder(BorderFactory.createTitledBorder(resources.getString("ActionMapper")));
      box.add(panel);

      panel = new JPanel(new BorderLayout());
View Full Code Here

    center_panel.add(down_value, new GridBagConstraints(2, 7, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    center_panel.add(connected_to_value, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    update_server_info();
    this.add(center_panel,BorderLayout.CENTER);
    this.add(bottom_panel, BorderLayout.SOUTH);
    final JDialog _this = this;
    bottom_panel.getCloseButton().addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
         _this.setVisible(false);     
      }
    });
  }
View Full Code Here

TOP

Related Classes of javax.swing.JDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.