本文整理了Java中javax.swing.JFrame.setMinimumSize()
方法的一些代码示例,展示了JFrame.setMinimumSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.setMinimumSize()
方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:setMinimumSize
暂无
代码示例来源:origin: RipMeApp/ripme
private void pack() {
SwingUtilities.invokeLater(() -> {
Dimension preferredSize = mainFrame.getPreferredSize();
mainFrame.setMinimumSize(preferredSize);
if (isCollapsed()) {
mainFrame.setSize(preferredSize);
}
});
}
代码示例来源:origin: stackoverflow.com
frame.setMinimumSize(new Dimension(520,600));
frame.setVisible(true);
代码示例来源:origin: 4thline/cling
getLogPanel().setPreferredSize(new Dimension(800, 175));
getView().setMinimumSize(new Dimension(150, 200));
getView().add(statusIconPanel, BorderLayout.WEST);
getView().add(getLogPanel(), BorderLayout.CENTER);
代码示例来源:origin: 4thline/cling
playerWindow.setMinimumSize(new Dimension(320, 240));
playerWindow.pack();
playerWindow.setVisible(true);
代码示例来源:origin: Nilhcem/FakeSMTP
mainFrame.setMinimumSize(frameSize);
代码示例来源:origin: i2p/i2p.i2p
frame.setMinimumSize(new Dimension(0, 0));
frame.setSize(0, 0);
final JPopupMenu menu = getSwingMainMenu();
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
private void setupCameraFrame()
{
cameraFrame = new JFrame(topicName);
cameraFrame.setMinimumSize(new Dimension(800, 800));
cameraPanel = new JPanel();
cameraFrame.add(cameraPanel);
cameraFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
cameraFrame.setVisible(true);
}
代码示例来源:origin: apache/ctakes
static private JFrame createFrame() {
final JFrame frame = new JFrame( "cTAKES Simple Pipeline Fabricator" );
frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE );
// Use 1024 x 768 as the minimum required resolution (XGA)
// iPhone 3 : 480 x 320 (3:2, HVGA)
// iPhone 4 : 960 x 640 (3:2, unique to Apple)
// iPhone 5 : 1136 x 640 (under 16:9, unique to Apple)
// iPad 3&4 : 2048 x 1536 (4:3, QXGA)
// iPad Mini: 1024 x 768 (4:3, XGA)
final Dimension size = new Dimension( 800, 600 );
frame.setSize( size );
frame.setMinimumSize( size );
// System.setProperty( "apple.laf.useScreenMenuBar", "true" );
return frame;
}
代码示例来源:origin: sing-group/GC4S
/**
* Shows a {@code JFrame} containing the specified {@code component} and
* {@code size}
*
* @param component the {@code Component} to show
* @param size the frame size
*/
public static final void showComponent(Component component,
Dimension size) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(component);
frame.pack();
frame.setVisible(true);
frame.setMinimumSize(size);
}
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame("FrameDemo");
frame.setMinimumSize(new Dimension(800, 400));
JButton button = new JButton("Cliccami");
MyButtonListener listener = new MyButtonListener();
button.addActionListener(listener);
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
private void setupRecordButtonFrame()
{
recordButtonFrame = new JFrame("Record");
recordButtonFrame.setMinimumSize(new Dimension(300, 40));
recordButtonPanel = new JPanel();
setupRecordButtonPanel();
recordButtonFrame.add(recordButtonPanel);
recordButtonFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
recordButtonFrame.setVisible(showRecordingButtons);
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) {
JFrame frame = new JFrame();
Dimension min = new Dimension(500,500);
frame.setMinimumSize(min);
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension max = toolkit.getScreenSize();
frame.setMaximumSize(max);
frame.setVisible(true);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
代码示例来源:origin: stackoverflow.com
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFrame frame = new JFrame("FrameDemo");
frame.setMinimumSize(new Dimension(800, 400));
JButton button = new JButton("Cliccami");
MyButtonListener listener = new MyButtonListener();
button.addActionListener(listener);
}
});
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame("FrameDemo");
frame.setMinimumSize(new Dimension(800, 400));
JButton button = new JButton("Cliccami");
MyButtonListener listener = new MyButtonListener();
button.addActionListener(listener);
代码示例来源:origin: net.mikera/mikera
@SuppressWarnings("serial")
public static Frame display(final Image image) {
JFrame f=new JFrame("Image popup");
JComponent c=new JComponent() {
public void paint(Graphics g) {
g.drawImage(image,0,0,null);
}
};
c.setMinimumSize(new Dimension(image.getWidth(null),image.getHeight(null)));
f.setMinimumSize(new Dimension(image.getWidth(null)+50,image.getHeight(null)+50));
f.add(c);
f.setVisible(true);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
return f;
}
代码示例来源:origin: sc.fiji/fiji-lib
public void openFrame(String label, DefaultMutableTreeNode node) {
node(node, label);
root = new DefaultMutableTreeNode("Root");
root.add(node);
JTree tree = new JTree(root);
tree.setRootVisible(false);
tree.addTreeWillExpandListener(this);
JScrollPane pane = new JScrollPane(tree);
//pane.setMinimumSize(new Dimension(300, 100));
JFrame frame = new JFrame("Object Inspector");
frame.setContentPane(pane);
frame.setMinimumSize(new Dimension(600, 500));
frame.pack();
frame.setDefaultCloseOperation(frame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
}
代码示例来源:origin: Nilhcem/markdown2html
/**
* Creates the main window and makes it visible.
*/
public MainFrame() {
Dimension frameSize = new Dimension(640, 440);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setSize(frameSize);
mainFrame.setMinimumSize(frameSize);
mainFrame.setJMenuBar(menu.get());
mainFrame.getContentPane().add(panel.get());
mainFrame.setLocationRelativeTo(null); // Center main frame
mainFrame.setVisible(true);
}
}
代码示例来源:origin: com.thesett/debug_ui_tools_swing
/** {@inheritDoc} */
public void showMainWindow()
{
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setMinimumSize(new Dimension(800, 600));
frame.setPreferredSize(new Dimension(1000, 800));
layout = new DesktopAppLayout();
frame.getContentPane().setLayout(layout);
frame.setVisible(true);
JRootPane rootPane = frame.getRootPane();
rootPane.getInputMap().put(KeyStroke.getKeyStroke("SPACE"), "pressed");
}
代码示例来源:origin: stackoverflow.com
JFrame frame = new JFrame();
frame.setResizable(false);
frame.pack();
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
frame.setMinimumSize(frame.getSize());
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
public static void main(String[] argv) {
JFrame f = new JFrame();
VCFUploadApp app = new VCFUploadApp();
f.setPreferredSize(new Dimension(400, 400));
f.setMinimumSize(new Dimension(400, 400));
app.viewWillLoad();
f.add(app.getView());
f.pack();
f.show();
app.viewDidLoad();
}
内容来源于网络,如有侵权,请联系作者删除!