Package javax.swing

Examples of javax.swing.JInternalFrame$JDesktopIcon


public class getDesktopIcon implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    JDesktopIcon icon = new JDesktopIcon(f);
    f.setDesktopIcon(icon);
    harness.check(f.getDesktopIcon(), icon);

    f.setDesktopIcon(null);
    harness.check(f.getDesktopIcon(), null);
  }
View Full Code Here


    lastEvent = e;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    harness.check(!f.isClosable());
    f.addPropertyChangeListener(this);
    f.setClosable(true);
    harness.check(f.isClosable());
    harness.check(lastEvent.getPropertyName(), "closable");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), Boolean.FALSE);
    harness.check(lastEvent.getNewValue(), Boolean.TRUE);
  }
View Full Code Here

public class getAccessibleValue implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    AccessibleContext ac = f.getAccessibleContext();
    // the AccessibleContext implements the AccessibleValue interface
    harness.check(ac.getAccessibleValue() == ac);
  }
View Full Code Here

    lastEvent = e;
  }
 
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("F1");
    f.addPropertyChangeListener(this);
    f.setTitle("F2");
    harness.check(f.getTitle(), "F2");
    harness.check(lastEvent.getPropertyName(), "title");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), "F1");
    harness.check(lastEvent.getNewValue(), "F2");
   
    lastEvent = null;
    f.setTitle(null);
    harness.check(f.getTitle(), null);
    harness.check(lastEvent.getPropertyName(), "title");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), "F2");
    harness.check(lastEvent.getNewValue(), null);
   
    // setting null again generates no event
    lastEvent = null;
    f.setTitle(null);
    harness.check(lastEvent.getPropertyName(), "title");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), null);
    harness.check(lastEvent.getNewValue(), null);
   
    f.setTitle("F3");
    harness.check(f.getTitle(), "F3");
    harness.check(lastEvent.getPropertyName(), "title");
    harness.check(lastEvent.getSource(), f);
    harness.check(lastEvent.getOldValue(), null);
    harness.check(lastEvent.getNewValue(), "F3");   
  }
View Full Code Here

public class getMaximumAccessibleValue implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    AccessibleContext ac = f.getAccessibleContext();
    AccessibleValue av = ac.getAccessibleValue();
    harness.check(av.getMaximumAccessibleValue(),
            new Integer(Integer.MAX_VALUE))// not specified, but the ref
                                              // impl returns this
  }
View Full Code Here

    public static void main(String[] args) {
        Frame wnd = new Frame();
        try {
            wnd.setSize(600, 400);
            JDesktopPane jdtp = new JDesktopPane();
            JInternalFrame jif = new JInternalFrame("Test");
            jif.setSize(100, 100);
            jif.setLocation(10, 10);
            jif.setResizable(true);
            jif.setClosable(true);
            jif.setIconifiable(true);
            jif.setMaximizable(true);
            jif.setSelected(true);
            jdtp.add(jif);
            wnd.add(jdtp, BorderLayout.CENTER);

            wnd.setVisible(true);
            jif.setVisible(true);

            Thread.sleep(5000);

            wnd.setVisible(false);
        } catch (Throwable t) {
View Full Code Here

public class JInternalFrameTest {
    public static void main(String[] argv) {
        JFrame f = new JFrame("Test");
        JDesktopPane dt = new JDesktopPane();
        f.getContentPane().add(dt, BorderLayout.CENTER);
        JInternalFrame ifr = new JInternalFrame("IF1");
        ifr.setLocation(0, 0);
        ifr.setSize(150, 150);
        ifr.setResizable(true);
        ifr.setClosable(true);
        ifr.setMaximizable(true);
        dt.add(ifr);
        ifr.setVisible(true);

        JInternalFrame ifr2 = new JInternalFrame("IF2");
        ifr2.setLocation(20, 20);
        ifr2.setSize(150, 150);
        ifr2.setResizable(true);
        ifr2.setClosable(true);
        ifr2.setMaximizable(true);
        dt.add(ifr2);
        ifr2.setVisible(true);

        JInternalFrame ifr3 = new JInternalFrame("IF3");
        ifr3.setLocation(40, 40);
        ifr3.setSize(150, 150);
        ifr3.setResizable(true);
        ifr3.setClosable(true);
        ifr3.setMaximizable(true);
        dt.add(ifr3);
        ifr3.setVisible(true);

        f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        f.setLocation(0, 0);
        f.setSize(300, 300);
        f.setVisible(true);
View Full Code Here

        selectNextFrame(SwingToolkit.getJNodeToolkit().getAwtContext().getDesktop());
    }

    private void selectNextFrame(JDesktopPane desktop) {
        JInternalFrame[] frames = desktop.getAllFrames();
        JInternalFrame sel = null;
        int z = Integer.MAX_VALUE;
        for (int i = 0; i < frames.length; i++) {
            JInternalFrame f = frames[i];
            if (!f.isIcon() && f.isVisible()) {
                int fz = desktop.getComponentZOrder(f);
                if (fz > -1 && fz < z) {
                    z = fz;
                    sel = f;
                }
View Full Code Here

         * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
         */
        public void valueChanged(ListSelectionEvent event) {
            final FrameWrapper sel = (FrameWrapper) list.getSelectedValue();
            if ((sel != null) && !sel.getFrame().isSelected()) {
                final JInternalFrame frame = sel.getFrame();
                final JDesktopPane desktop = frame.getDesktopPane();
                desktop.setSelectedFrame(frame);
            }
        }
View Full Code Here

public class constructor implements Testlet
{
  public void test(TestHarness harness)
  {
    JInternalFrame f = new JInternalFrame("Title");
    InternalFrameEvent e = new InternalFrameEvent(f,
            InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
    harness.check(e.getID(), InternalFrameEvent.INTERNAL_FRAME_ACTIVATED);
    harness.check(e.getInternalFrame(), f);
   
View Full Code Here

TOP

Related Classes of javax.swing.JInternalFrame$JDesktopIcon

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.