帮忙看下java代码哪里出问题了
发布网友
发布时间:2022-04-23 18:31
我来回答
共2个回答
热心网友
时间:2023-10-13 01:30
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
setSize(new Dimension(1000, 750));
setTitle("Frame Title");
statusBar.setText("");
jButton1.setText("jButton1");
jToolBar.setBounds(new Rectangle(0, 0, 750, 25));
jTabbedPane1.setBounds(new Rectangle(0, 30, 200, 604));
jCheckBox1.setBorder(titledBorder1);
jCheckBox1.setBorderPainted(true);
jCheckBox1.setText("是否隐藏坐标系");
jCheckBox1.setBounds(new Rectangle(24, 48, 138, 25));
jCheckBox1.addItemListener(new Frame1_jCheckBox1_itemAdapter(this));
jPanel1.setLayout(null);
jSpinner1.setBounds(new Rectangle(27, 129, 35, 20));
jLabel2.setText("像素为一单位");
jLabel2.setBounds(new Rectangle(63, 125, 78, 30));
jLabel1.setBackground(Color.blue);
jLabel1.setOpaque(true);
jLabel1.setText("jLabel1");
jLabel1.setBounds(new Rectangle(31, 228, 57, 41));
jLabel3.setText("选择坐标系颜色");
jLabel3.setBounds(new Rectangle(28, 195, 102, 40));
jToolBar.add(jButton1);
contentPane.add(jToolBar, null);
contentPane.add(paintPanel, null);
contentPane.add(jTabbedPane1);
jPanel1.add(jCheckBox1);
jPanel1.add(jLabel2);
jPanel1.add(jSpinner1);
jPanel1.add(jLabel3);
jPanel1.add(jLabel1);
jTabbedPane1.add(jPanel2, "双曲线");
jTabbedPane1.add(jPanel3, "直线");
jTabbedPane1.add(jPanel4, "jPanel4");
jTabbedPane1.add(jPanel1, "坐标系");
paintPanel.setBounds(new Rectangle(200, 25, 1500, 610));
}
public void jCheckBox1_itemStateChanged(ItemEvent e) {
if (e.getStateChange()==ItemEvent.SELECTED)
{ int AxisFlag=0;
repaint();
}
}
}
class Frame1_jCheckBox1_itemAdapter implements ItemListener {
private Frame1 adaptee;
Frame1_jCheckBox1_itemAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void itemStateChanged(ItemEvent e) {
adaptee.jCheckBox1_itemStateChanged(e);
}
}
隐藏坐标系不管用.应该怎么改?
热心网友
时间:2023-10-13 01:31
把报错信息也贴出来;
定义公共变量:AxisFlag;