Java 8 JInternalFrame - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 JInternalFrame class.

This code example shows how to use the following methods:setBounds, setVisible, getContentPane
    private static Robot robot;
    private JInternalFrame internal;
 
    public Test6325652(JFrame frame) {
        JDesktopPane desktop = new JDesktopPane();
        desktop.add(create(0));
        desktop.add(this.internal = create(1));
        frame.add(desktop);
    } 
 
    public void select() throws PropertyVetoException {
        this.internal.setSelected(true);
    } 
 
    public static void stepFirst() throws AWTException {
        robot = new Robot(); // initialize shared static field first time
        click(KeyEvent.VK_CONTROL, KeyEvent.VK_F9); // iconify internal frame
    } 
 
    public void stepFirstValidate() { 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:equals, isSelected, setSelected
        selectTopFrame(f);
    } 
 
    @Override 
    public void iconifyFrame(JInternalFrame f) {
        mostRecentlyUsedFrames.remove(f);
        selectTopFrame(f);
        delegate.iconifyFrame(f);
    } 
 
    @Override 
    public void maximizeFrame(JInternalFrame f) {
        delegate.maximizeFrame(f);
    } 
 
    @Override 
    public void minimizeFrame(JInternalFrame f) {
        delegate.minimizeFrame(f);
    } 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLocation, getHeight, getWidth, getDesktopPane
     * @param internalFrame a JInternalFrame object 
     */ 
    public static void centerOnScreen(@Nonnull JInternalFrame internalFrame) {
        requireNonNull(internalFrame, "Argument 'internalFrame' must not be null");
 
        JDesktopPane desktop = internalFrame.getDesktopPane();
        if (desktop == null) return;
        Dimension screen = desktop.getSize();
        Point center = new Point(screen.width / 2, screen.height / 2);
 
        double w = Math.min(internalFrame.getWidth(), screen.width);
        double h = Math.min(internalFrame.getHeight(), screen.height);
        int x = (int) (center.x - (w / 2));
        int y = (int) (center.y - (h / 2));
 
        Point corner = new Point( 
            (x >= 0 ? x : 0),
            (y >= 0 ? y : 0)
        ); 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBounds, add, setVisible
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isClosable, isIconifiable, isMaximizable
    public PlasticInternalFrameTitlePane(JInternalFrame frame) {
        super(frame);
    } 
 
    public void paintPalette(Graphics g) {
        boolean leftToRight = PlasticUtils.isLeftToRight(frame);
 
        int width = getWidth();
        int height = getHeight();
 
        if (paletteBumps == null) {
            paletteBumps =
                new PlasticBumps( 
                    0, 
                    0, 
                    PlasticLookAndFeel.getPrimaryControlHighlight(), 
                    PlasticLookAndFeel.getPrimaryControlInfo(), 
                    PlasticLookAndFeel.getPrimaryControlShadow()); 
        } 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLocation, getHeight, getWidth, getDesktopPane
package husacct.control.presentation.util; 
 
import java.awt.Point;
 
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
 
public class InternalFrameUtils { 
	public static void alignCenter(JInternalFrame internalFrame){
		 
		JDesktopPane desktopPane = internalFrame.getDesktopPane();
		 
		int desktopWidth = desktopPane.getWidth();
		int desktopHeight = desktopPane.getHeight();
		int frameWidth = internalFrame.getWidth();
		int frameHeight = internalFrame.getHeight();
		 
		Point newLocation = new Point((desktopWidth - frameWidth) / 2, (desktopHeight - frameHeight) / 2);
		 
		internalFrame.setLocation(newLocation);

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:add, pack, setLayout
This code example shows how to use the following methods:isIcon, isMaximum
 * @author Alex Ruiz 
 */ 
final class JInternalFrameIconQuery { 
  @RunsInCurrentThread 
  static boolean isIconified(@Nonnull JInternalFrame frame) {
    if (frame.isMaximum()) {
      return false; 
    } 
    return frame.isIcon();
  } 
 
  private JInternalFrameIconQuery() {} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isVisible
    assertThat(window.internalFrame().isVisible()).isTrue();
  } 
 
  @Test
  public void should_close_JInternalFrame() { 
    JInternalFrameCloseTask.close(internalFrame);
    robot.waitForIdle(); 
    assertThat(internalFrame.isVisible()).isFalse();
  } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLocation, setVisible, isResizable, setSelected, toBack
            p.y = p.y + FRAME_OFFSET;
        } 
        else { 
            p = new Point(0, 0);
        } 
        frame.setLocation(p.x, p.y);
        if (frame.isResizable()) {
            w = getWidth() - (getWidth()/3);
            h = getHeight() - (getHeight()/3);
            if (w < frame.getMinimumSize().getWidth()) { 
            	w = (int)frame.getMinimumSize().getWidth();
            } 
            if (h < frame.getMinimumSize().getHeight()) {
            	h = (int)frame.getMinimumSize().getHeight();
            } 
            frame.setSize(w, h);
        } 
        moveToFront(frame);
        frame.setVisible(true);
        try { 

5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 JInternalFrame Methods: