JOptionPane 变大
JOptionPane bigger
我正在 Java (eclipse) 上开发井字游戏。在我的电脑上,我的对话框非常小。我一直在努力让它变大。我没有任何运气。
我希望这里有人可以引导我朝着正确的方向前进。下面的代码是我的对话框代码:
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running");
提前致谢
如前所述here,您可以这样做:
UIManager.put("OptionPane.minimumSize",new Dimension(500,500));
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running" );
更新:
为了使字体更大,您可以在窗格中添加一个组件,例如 JLabel
;如下:
JLabel label = new JLabel("Tic Tac Toe Server is Running");
label.setFont(new Font("Arial", Font.BOLD, 18));
JOptionPane.showMessageDialog(frame, label);
我正在 Java (eclipse) 上开发井字游戏。在我的电脑上,我的对话框非常小。我一直在努力让它变大。我没有任何运气。 我希望这里有人可以引导我朝着正确的方向前进。下面的代码是我的对话框代码:
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running");
提前致谢
如前所述here,您可以这样做:
UIManager.put("OptionPane.minimumSize",new Dimension(500,500));
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running" );
更新:
为了使字体更大,您可以在窗格中添加一个组件,例如 JLabel
;如下:
JLabel label = new JLabel("Tic Tac Toe Server is Running");
label.setFont(new Font("Arial", Font.BOLD, 18));
JOptionPane.showMessageDialog(frame, label);