JOptionPane较大 [英] JOptionPane bigger
本文介绍了JOptionPane较大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发Java(日食)的Tic Tac Toe游戏.在我的计算机上,对话框很小.我一直在努力使它更大.我没有运气. 我希望这里有人可以引导我朝正确的方向前进.下面的代码是我的对话框代码:
I am working on a Tic Tac Toe game on Java (eclipse). On my computer my dialog box is really small. I been trying to make it bigger. I didn't have any luck. I was hoping someone here can lead me in the right direction. The code below is my dialog box code:
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running");
先谢谢您
推荐答案
如此处所述,您可以执行以下操作:
As mentioned here, you can do this:
UIManager.put("OptionPane.minimumSize",new Dimension(500,500));
JOptionPane.showMessageDialog(frame, "Tic Tac Toe Server is Running" );
更新:
为了增大字体大小,您可以在窗格中添加一个组件,例如JLabel
.如下:
Update:
For making the font size bigger, you could add a component, for exampe JLabel
, to the pane; as the following:
JLabel label = new JLabel("Tic Tac Toe Server is Running");
label.setFont(new Font("Arial", Font.BOLD, 18));
JOptionPane.showMessageDialog(frame, label);
这篇关于JOptionPane较大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文