當前位置: 首頁>>代碼示例>>Java>>正文


Java JInternalFrame.setResizable方法代碼示例

本文整理匯總了Java中javax.swing.JInternalFrame.setResizable方法的典型用法代碼示例。如果您正苦於以下問題:Java JInternalFrame.setResizable方法的具體用法?Java JInternalFrame.setResizable怎麽用?Java JInternalFrame.setResizable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JInternalFrame的用法示例。


在下文中一共展示了JInternalFrame.setResizable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupFieldsFrame

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
private void setupFieldsFrame() {
	frameFields = new JInternalFrame("Fields");
	frameFields.setResizable(true);
	frameFields.setIconifiable(true);
	frameFields.setBounds(frameClass.getWidth() + 11, 11, 180, 140);
	frameFields.setVisible(true);
	frameFields.setLayout(new BorderLayout());
	fields = new JList<>();
	fields.setCellRenderer(new MemberNodeRenderer());
	fields.addMouseListener(new MemberNodeClickListener(this, node, fields));
	DefaultListModel<FieldNode> model = new DefaultListModel<>();
	for (FieldNode fn : node.fields) {
		model.addElement(fn);
	}
	if (node.fields.size() == 0) {
		fields.setVisibleRowCount(5);
		fields.setPrototypeCellValue(new FieldNode(0, "Add_A_Field", "Ljava/lang/Object;", null, null));
	}
	fields.setModel(model);
	frameFields.add(new JScrollPane(fields), BorderLayout.CENTER);
	frameFields.pack();
}
 
開發者ID:Col-E,項目名稱:Recaf,代碼行數:23,代碼來源:ClassDisplayPanel.java

示例2: createAndShowGUI

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
private static void createAndShowGUI() {

        frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLayout(new BorderLayout());

        desktopPane = new JDesktopPane();
        desktopPane.setBackground(BACKGROUND_COLOR);

        frame.add(desktopPane, BorderLayout.CENTER);
        frame.setSize(FRAME_SIZE, FRAME_SIZE);
        frame.setVisible(true);

        internalFrame = new JInternalFrame("Test");
        internalFrame.setSize(FRAME_SIZE / 2, FRAME_SIZE / 2);
        desktopPane.add(internalFrame);
        internalFrame.setVisible(true);
        internalFrame.setResizable(true);

        frame.setVisible(true);
    }
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:22,代碼來源:JInternalFrameDraggingTest.java

示例3: getProgressMonitorContainer

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Returns the progress monitor container that is either a JDialog or a JInternFrame.
 * @return the progress monitor container
 */
private Container getProgressMonitorContainer() {
	if (progressMonitorContainer==null) {
		
		Dimension defaultSize = new Dimension(570, 188);
		if (this.parentDesktopPane==null) {
			JDialog jDialog = new JDialog(this.owner);	
			jDialog.setSize(defaultSize);
			jDialog.setResizable(false);
			if (this.owner==null) {
				jDialog.setAlwaysOnTop(true);
			}
			jDialog.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jDialog.setIconImage(this.iconImage.getImage());	
			}
			jDialog.setContentPane(this.getJContentPane());
			jDialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jDialog; 
			this.setLookAndFeel();	
				
		} else {
			JInternalFrame jInternalFrame = new JInternalFrame();
			jInternalFrame.setSize(defaultSize);
			jInternalFrame.setResizable(false);
			
			jInternalFrame.setTitle(this.windowTitle);
			if (this.iconImage!=null) {
				jInternalFrame.setFrameIcon(this.iconImage);	
			}
			jInternalFrame.setContentPane(this.getJContentPane());
			jInternalFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
			
			this.progressMonitorContainer = jInternalFrame;
		}
		
	}
	return progressMonitorContainer;
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:44,代碼來源:ProgressMonitor.java

示例4: setupMethodsFrame

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
private void setupMethodsFrame() {
	frameMethods = new JInternalFrame("Methods");
	frameMethods.setResizable(true);
	frameMethods.setIconifiable(true);
	int fw = frameFields == null ? 0 : frameFields.getWidth();
	frameMethods.setBounds(fw + frameClass.getWidth() + 11, 11, 180, 120);
	frameMethods.setVisible(true);
	frameMethods.setLayout(new BorderLayout());

	methods = new JList<>();
	methods.setCellRenderer(new MemberNodeRenderer());
	methods.addMouseListener(new MemberNodeClickListener(this, node, methods));
	DefaultListModel<MethodNode> model = new DefaultListModel<>();
	for (MethodNode mn : node.methods) {
		model.addElement(mn);
	}
	if (node.methods.size() == 0) {
		methods.setVisibleRowCount(5);
		methods.setPrototypeCellValue(new MethodNode(0, "Add_A_Method", "()Ljava/lang/Object;", null, null));
	}
	methods.setModel(model);
	frameMethods.add(new JScrollPane(methods), BorderLayout.CENTER);
	// TODO: Switch to table. A table may be bigger but allows for sorting
	// of members.
	//
	// frameMethods.add(new JScrollPane(MemberTable.create(node.methods)),
	// BorderLayout.CENTER);
	frameMethods.pack();
}
 
開發者ID:Col-E,項目名稱:Recaf,代碼行數:30,代碼來源:ClassDisplayPanel.java

示例5: addAsFrame

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Adds a component on this Canvas inside a frame.
 *
 * @param comp The component to add to the canvas.
 * @param toolBox Should be set to true if the resulting frame is
 *     used as a toolbox (that is: it should not be counted as a
 *     frame).
 * @param popupPosition A preferred {@code PopupPosition}.
 * @param resizable Whether this component can be resized.
 * @return The {@code JInternalFrame} that was created and added.
 */
private JInternalFrame addAsFrame(JComponent comp, boolean toolBox,
                                  PopupPosition popupPosition,
                                  boolean resizable) {
    final int FRAME_EMPTY_SPACE = 60;

    final JInternalFrame f = (toolBox) ? new ToolBoxFrame()
        : new JInternalFrame();
    if (f.getContentPane() instanceof JComponent) {
        JComponent c = (JComponent) f.getContentPane();
        c.setOpaque(false);
        c.setBorder(null);
    }

    if (comp.getBorder() != null) {
        if (comp.getBorder() instanceof EmptyBorder) {
            f.setBorder(Utility.blankBorder(10, 10, 10, 10));
        } else {
            f.setBorder(comp.getBorder());
            comp.setBorder(Utility.blankBorder(5, 5, 5, 5));
        }
    } else {
        f.setBorder(null);
    }

    final FrameMotionListener fml = new FrameMotionListener(f);
    comp.addMouseMotionListener(fml);
    comp.addMouseListener(fml);
    if (f.getUI() instanceof BasicInternalFrameUI) {
        BasicInternalFrameUI biu = (BasicInternalFrameUI) f.getUI();
        biu.setNorthPane(null);
        biu.setSouthPane(null);
        biu.setWestPane(null);
        biu.setEastPane(null);
    }

    f.getContentPane().add(comp);
    f.setOpaque(false);
    f.pack();
    int width = f.getWidth();
    int height = f.getHeight();
    if (width > getWidth() - FRAME_EMPTY_SPACE) {
        width = Math.min(width, getWidth());
    }
    if (height > getHeight() - FRAME_EMPTY_SPACE) {
        height = Math.min(height, getHeight());
    }
    f.setSize(width, height);
    Point p = chooseLocation(comp, width, height, popupPosition);
    f.setLocation(p);
    this.add(f, MODAL_LAYER);
    f.setName(comp.getClass().getSimpleName());

    f.setFrameIcon(null);
    f.setVisible(true);
    f.setResizable(resizable);
    try {
        f.setSelected(true);
    } catch (java.beans.PropertyVetoException e) {}

    return f;
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:73,代碼來源:Canvas.java


注:本文中的javax.swing.JInternalFrame.setResizable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。