Search in sources :

Example 16 with JInternalFrame

use of javax.swing.JInternalFrame in project sic by belluccifranco.

the class PrincipalGUI method mnuItm_ProveedoresActionPerformed.

//GEN-LAST:event_mnuItm_UsuariosActionPerformed
private void mnuItm_ProveedoresActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnuItm_ProveedoresActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), ProveedoresGUI.class);
    if (gui == null) {
        gui = new ProveedoresGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 17 with JInternalFrame

use of javax.swing.JInternalFrame in project sic by belluccifranco.

the class PrincipalGUI method mnuItm_ClientesActionPerformed.

//GEN-LAST:event_mnuItm_ProductosActionPerformed
private void mnuItm_ClientesActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnuItm_ClientesActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), ClientesGUI.class);
    if (gui == null) {
        gui = new ClientesGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 18 with JInternalFrame

use of javax.swing.JInternalFrame in project GCViewer by chewiebug.

the class Arrange method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
    final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
    for (int i = 0; i < frames.length; i++) {
        final JInternalFrame frame = frames[i];
        desktopManager.deiconifyFrame(frame);
        try {
            frame.setMaximum(false);
        } catch (PropertyVetoException e1) {
            e1.printStackTrace();
        }
        final int height = gcViewer.getDesktopPane().getHeight() / frames.length;
        desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) DesktopManager(javax.swing.DesktopManager) JInternalFrame(javax.swing.JInternalFrame)

Example 19 with JInternalFrame

use of javax.swing.JInternalFrame in project jdk8u_jdk by JetBrains.

the class InsetsEncapsulation method run.

@Override
public void run() {
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    runTest(new JScrollBar());
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) JTextArea(javax.swing.JTextArea) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTableHeader(javax.swing.table.JTableHeader) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JScrollBar(javax.swing.JScrollBar) JTextPane(javax.swing.JTextPane) JToggleButton(javax.swing.JToggleButton) JSlider(javax.swing.JSlider) JMenuItem(javax.swing.JMenuItem) JComponent(javax.swing.JComponent) Component(java.awt.Component) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JToolBar(javax.swing.JToolBar) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JPopupMenu(javax.swing.JPopupMenu) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) JTable(javax.swing.JTable) JEditorPane(javax.swing.JEditorPane) JSpinner(javax.swing.JSpinner) JRootPane(javax.swing.JRootPane) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Example 20 with JInternalFrame

use of javax.swing.JInternalFrame in project jdk8u_jdk by JetBrains.

the class MetalworksFrame method newDocument.

public void newDocument() {
    JInternalFrame doc = new MetalworksDocumentFrame();
    desktop.add(doc, DOCLAYER);
    try {
        doc.setVisible(true);
        doc.setSelected(true);
    } catch (java.beans.PropertyVetoException e2) {
    }
}
Also used : JInternalFrame(javax.swing.JInternalFrame)

Aggregations

JInternalFrame (javax.swing.JInternalFrame)36 Point (java.awt.Point)12 PropertyVetoException (java.beans.PropertyVetoException)12 Dimension (java.awt.Dimension)9 Component (java.awt.Component)7 JPanel (javax.swing.JPanel)7 JScrollPane (javax.swing.JScrollPane)7 JTable (javax.swing.JTable)7 BorderLayout (java.awt.BorderLayout)6 JButton (javax.swing.JButton)6 JLabel (javax.swing.JLabel)6 JComponent (javax.swing.JComponent)5 JMenu (javax.swing.JMenu)4 Jynstrument (jmri.jmrit.jython.Jynstrument)4 Container (java.awt.Container)3 JDesktopPane (javax.swing.JDesktopPane)3 JMenuBar (javax.swing.JMenuBar)3 JMenuItem (javax.swing.JMenuItem)3 TableRowSorter (javax.swing.table.TableRowSorter)3 ButtonEditor (jmri.util.table.ButtonEditor)3