我正在开发一个基于Java (eclipse)的Tic脚趾游戏。在我的计算机上,我的对话框非常小。我一直在努力让它变大。我一点运气都没有。我希望这里有人能把我引向正确的方向。下面的代码是我的对话框代码:
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running");先谢谢你
发布于 2017-04-26 01:04:47
正如前面提到的here,您可以这样做:
UIManager.put("OptionPane.minimumSize",new Dimension(500,500));
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running" );Update:为了使字体大小更大,可以向窗格中添加一个组件(例如JLabel );如下所示:
JLabel label = new JLabel("Tic Tac Toe Server is Running");
label.setFont(new Font("Arial", Font.BOLD, 18));
JOptionPane.showMessageDialog(frame, label);https://stackoverflow.com/questions/43623278
复制相似问题