Package javax.swing

Examples of javax.swing.JFrame


    }

    public void showGUI(String filename, int actionMask) {

        if (frame == null) {
            frame = new JFrame(filename);

            filePath.replace(0, filePath.capacity(), filename);

            frame.getContentPane().add(getGUI(null, actionMask),
                    BorderLayout.CENTER);
View Full Code Here


            JScrollPane scrollPane = new JScrollPane(p, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
            scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
            scrollPane.setAlignmentY(Component.TOP_ALIGNMENT);

            // create the palette internal window
            paletteWindow = new JFrame("RPF Coverage Palette");

            paletteWindow.setContentPane(scrollPane);
            paletteWindow.pack();//layout all the components
        }
        return paletteWindow;
View Full Code Here

                g.drawImage(bitmap, x * 256, y * 256, null);
            }
        }

        JLabel picture = new JLabel(new ImageIcon(bigImage));
        JFrame frame = com.bbn.openmap.util.PaletteHelper.getPaletteWindow(picture,
                "RPF Frame",
                null);
        frame.setSize(new Dimension(500, 500));
        frame.setVisible(true);
    }
View Full Code Here

     * @param aKey The key for this tool.
     */
    public void setKey(String aKey) {}

    public static void main(String[] argv) {
        JFrame frame = new JFrame("IconFactoryTestingTool");
        frame.getContentPane().add(new IconFactoryTestingTool().getFace());
        frame.pack();
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                // need a shutdown event to notify other gui beans and
                // then exit.
                System.exit(0);
            }
        });

        frame.setVisible(true);
    }
View Full Code Here

     * passed-in layer
     *
     * @param layer The layer whose data is to be displayed
     */
    public void showTable(final EsriLayer layer) {
        JFrame frame = new JFrame("Table");
        DbfTableModel model = layer.getModel();
        JTable table = new JTable(model);
        JScrollPane pane = new JScrollPane(table);
        frame.getContentPane().add(pane, BorderLayout.CENTER);

        ListSelectionModel lsm = table.getSelectionModel();
        lsm.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                //Ignore extra messages.
                if (e.getValueIsAdjusting()) {
                    return;
                }
                ListSelectionModel lsm2 = (ListSelectionModel) e.getSource();
                if (lsm2.isSelectionEmpty()) {
                    //no rows are selected
                } else {
                    int index = lsm2.getMinSelectionIndex();
                    EsriGraphicList list = layer.getEsriGraphicList();
                    OMGraphic graphic = list.getOMGraphicAt(index);
                    graphic.select();
                    list.generate(_mapBean.getProjection());
                    layer.repaint();
                }
            }
        });
        frame.setSize(400, 300);
        frame.setVisible(true);
    }
View Full Code Here

     * Main method to facilitate testing and to run as stand alone
     * application.
     */
    public static void main(String args[]) {
        ExampleApplet example = new ExampleApplet();
        JFrame frame = new JFrame();
        frame.getContentPane().add(example);
        frame.setSize(800, 600);
        frame.setVisible(true);
    }
View Full Code Here

     * passed-in layer
     *
     * @param layer The layer whose data is to be displayed
     */
    public void showTable(final EsriLayer layer) {
        JFrame frame = new JFrame("Table");
        DbfTableModel model = layer.getModel();
        JTable table = new JTable(model);
        JScrollPane pane = new JScrollPane(table);
        frame.getContentPane().add(pane, BorderLayout.CENTER);

        ListSelectionModel lsm = table.getSelectionModel();
        lsm.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                //Ignore extra messages.
                if (e.getValueIsAdjusting()) {
                    return;
                }
                ListSelectionModel lsm2 = (ListSelectionModel) e.getSource();
                if (lsm2.isSelectionEmpty()) {
                    //no rows are selected
                } else {
                    int index = lsm2.getMinSelectionIndex();
                    EsriGraphicList list = layer.getEsriGraphicList();
                    OMGraphic graphic = list.getOMGraphicAt(index);
                    graphic.select();
                    list.generate(_mapBean.getProjection());
                    layer.repaint();
                }
            }
        });
        frame.setSize(400, 300);
        frame.setVisible(true);
    }
View Full Code Here

    }
    else
    {
      if (frame == null)
      {
        frame = new JFrame();
      }
      cd = new ComponentDrawable(frame);
      cd.setPaintSynchronized(true);
    }
View Full Code Here

            hb.setFont(ComponentFactory.getSystemFont());
            hb.setDisplayed(true);
           
            Window helpWindow = hb.getWindowPresentation().getHelpWindow();
            if (helpWindow instanceof JFrame) {
                JFrame helpFrame = (JFrame) helpWindow;
                helpFrame.setIconImage(IconLibrary._icoMain.getImage());
                helpFrame.setTitle(DcResources.getText("lblDataCrowHelp"));
            }

        } catch (Exception e) {
            logger.error(DcResources.getText("msgErrorOpeningHelp"), e);
            DcSwingUtilities.displayErrorMessage("msgErrorOpeningHelp");
View Full Code Here

     * @return JPanel sub-palette
     */
    protected JPanel getGraphicPalette(final GraphicBase obj, final String title) {

        final JComboBox jcb;
        final JFrame jframe;
        final JRootPane main;
        final JPanel parent;

        parent = PaletteHelper.createVerticalPanel(title);
        jframe = new JFrame();
        main = jframe.getRootPane();

        // different controls for different render types
        jcb = new JComboBox();
        jcb.addItem("LatLon");// indices correspond to LineType.java
        jcb.addItem("XY");
        jcb.addItem("Offset");
        jcb.setSelectedIndex(obj.rt - 1);
        jcb.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                obj.setRender(jcb);
                switch (obj.rt) {
                case OMGraphic.RENDERTYPE_LATLON:
                    jframe.setTitle(title + " - LatLon");
                    main.getContentPane().removeAll();
                    main.getContentPane().add(obj.getGUI());
                    jframe.pack();
                    jframe.setVisible(true);
                    break;
                case OMGraphic.RENDERTYPE_XY:
                    jframe.setTitle(title + " - XY");
                    main.getContentPane().removeAll();
                    main.getContentPane().add(obj.getGUI());
                    jframe.pack();
                    jframe.setVisible(true);
                    break;
                case OMGraphic.RENDERTYPE_OFFSET:
                    jframe.setTitle(title + " - XY Offset");
                    main.getContentPane().removeAll();
                    main.getContentPane().add(obj.getGUI());
                    jframe.pack();
                    jframe.setVisible(true);
                    break;
                default:
                    System.err.println("ARRRR!");
                    break;
                }
View Full Code Here

TOP

Related Classes of javax.swing.JFrame

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.