java - GUI bug in JDialog box?
问题描述
Currently making a DnD utility that calls a window to roll dice in. When you close the window and reopen it, a lot of the user interface is moved around and non functional. Where did I go wrong?
//////////////////////////////////////////////////////////
mntmDiceRoller.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
DisplayRollPanel();
}
private void DisplayRollPanel() {
Delta.rollPane.main(null);
}
});
//////////////////////////////////////////////////////////
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
rollPane dialog = new rollPane();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public rollPane() {
setResizable(false);
setName("DiceRollerDialog");
setType(Type.POPUP);
setTitle("Dice Roller");
setBounds(100, 100, 450, 350);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(new MigLayout("", "[][grow][][grow][][19.00,grow][][grow][][][][grow][][]", "[][][][][][][][][][][]"));
/////////////rest of the code omitted/////////////////////////////////
解决方案
推荐阅读
- java - 检测和替换不成对的降价符号,而不是改变成对的符号
- c# - 如何在 uwp 打印中断开打印事件处理程序?
- r - nhanes 2003 -2004 年数据的描述性统计
- angular - 我正在尝试使用角度上传图像但出现错误
- c++ - 为什么 == 运算符产生的结果与 strcmp 不同?
- package - Elm 安装包位置
- javascript - Javascript Canvas 问题:为什么我在画布上的点与图表的高度不对应?
- node.js - 将密码存储在 Node.js 文件中是否安全?
- vue.js - 在 Echarts 中绘制 y 轴平均值的水平线
- python - 熊猫从每个小时中为每个 ID 选择值