- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
到处寻找后,没有人遇到同样的问题。我需要编辑 netbeans 生成的代码,因为当我在设计 View 中删除一些 Swing 组件时,一个错误导致变量声明被删除,但在使用这些组件的 initComponents() 中,仍然存在抛出错误并且不允许我运行程序,代码如下:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package controlpanel;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JTextArea;
/**
*
* @author Cam_2
*/
public class ControlPanel extends javax.swing.JFrame {
/**
* Creates new form ControlPanel
*/
public ControlPanel() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList();
jButton1 = new javax.swing.JButton();
jInternalFrame1 = new javax.swing.JInternalFrame();
jLabel1 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(130, 0), new java.awt.Dimension(130, 0), new java.awt.Dimension(130, 32767));
jCheckBox1 = new javax.swing.JCheckBox();
jInternalFrame2 = new javax.swing.JInternalFrame();
redLight = new javax.swing.JCheckBox();
whiteLight = new javax.swing.JCheckBox();
blueLight = new javax.swing.JCheckBox();
greenLight = new javax.swing.JCheckBox();
yellowLight = new javax.swing.JCheckBox();
jInternalFrame3 = new javax.swing.JInternalFrame();
jButton3 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jFormattedTextField1 = new javax.swing.JFormattedTextField();
jFormattedTextField2 = new javax.swing.JFormattedTextField();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList();
jList1.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setAlwaysOnTop(true);
jButton1.setText("Apply Changes");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jInternalFrame1.setTitle("Button Controller");
jInternalFrame1.setToolTipText("Controls the buttons that normally activate the lights.");
jInternalFrame1.setPreferredSize(new java.awt.Dimension(140, 160));
jInternalFrame1.setVisible(true);
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Button Activation");
jLabel1.setToolTipText("Controls whether pressing a button will power the light or not");
jButton2.setText("Enable");
jButton2.setToolTipText("Controls whether pressing a button will power the light or not.");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Currently Disabled");
jLabel2.setToolTipText("Controls whether pressing a button will power the light or not");
jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jCheckBox1.setText("Toggle Mode");
jCheckBox1.setToolTipText("Controls whether pressing a button will toggle the light on rather than only powering the light while the button is held down.");
javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 1, Short.MAX_VALUE))
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckBox1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCheckBox1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jInternalFrame2.setTitle("Light Controller");
jInternalFrame2.setToolTipText("Controls all the LED lights.");
jInternalFrame2.setPreferredSize(new java.awt.Dimension(140, 200));
jInternalFrame2.setVisible(true);
redLight.setText("Red Light");
whiteLight.setText("White Light");
blueLight.setText("Blue Light");
greenLight.setText("Green Light");
yellowLight.setText("Yellow Light");
javax.swing.GroupLayout jInternalFrame2Layout = new javax.swing.GroupLayout(jInternalFrame2.getContentPane());
jInternalFrame2.getContentPane().setLayout(jInternalFrame2Layout);
jInternalFrame2Layout.setHorizontalGroup(
jInternalFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jInternalFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(redLight)
.addComponent(yellowLight)
.addComponent(greenLight)
.addComponent(blueLight)
.addComponent(whiteLight))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jInternalFrame2Layout.setVerticalGroup(
jInternalFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(redLight)
.addGap(5, 5, 5)
.addComponent(yellowLight)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(greenLight)
.addGap(5, 5, 5)
.addComponent(blueLight)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(whiteLight)
.addContainerGap(12, Short.MAX_VALUE))
);
jInternalFrame3.setTitle("Screen Controller");
jInternalFrame3.setPreferredSize(new java.awt.Dimension(140, 313));
jInternalFrame3.setVisible(true);
jButton3.setText("Toggle On");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("LED Char Screen");
jLabel3.setToolTipText("Control whether the LED matrix is on or off.");
jLabel3.setPreferredSize(new java.awt.Dimension(107, 16));
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel4.setText("Currently Off");
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel5.setText("Text To Display:");
jLabel5.setToolTipText("The text shown on the LED screen.");
jFormattedTextField1.setBackground(new java.awt.Color(204, 204, 255));
jFormattedTextField1.setToolTipText("Maximum characters is 20.");
jFormattedTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
jFormattedTextField1FocusLost(evt);
}
});
jFormattedTextField2.setBackground(new java.awt.Color(204, 204, 255));
jFormattedTextField2.setToolTipText("Maximum characters is 20.");
jFormattedTextField2.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
jFormattedTextField2FocusLost(evt);
}
});
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel6.setText("Line 1:");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel7.setText("Line 2:");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
javax.swing.GroupLayout jInternalFrame3Layout = new javax.swing.GroupLayout(jInternalFrame3.getContentPane());
jInternalFrame3.getContentPane().setLayout(jInternalFrame3Layout);
jInternalFrame3Layout.setHorizontalGroup(
jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jInternalFrame3Layout.createSequentialGroup()
.addGroup(jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(jFormattedTextField2)))
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jInternalFrame3Layout.setVerticalGroup(
jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jInternalFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jFormattedTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(489, 489, 489))
);
jList1.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jInternalFrame3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
.addComponent(jInternalFrame2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
.addComponent(jInternalFrame1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 992, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(182, 182, 182)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jInternalFrame2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jInternalFrame3, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(86, 86, 86)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 287, Short.MAX_VALUE))))
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
javax.swing.JButton src = (javax.swing.JButton) evt.getSource();
if(src.getText().equalsIgnoreCase("Enable")) {
jLabel2.setText("Currently Enabled");
src.setText("Disable");
} else {
jLabel2.setText("Currently Disabled");
src.setText("Enable");
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
javax.swing.JButton src = (javax.swing.JButton) evt.getSource();
if(src.getText().equalsIgnoreCase("Toggle On")) {
jLabel4.setText("Currently On");
src.setText("Toggle Off");
} else {
jLabel4.setText("Currently Off");
src.setText("Toggle On");
}
}
private void jFormattedTextField1FocusLost(java.awt.event.FocusEvent evt) {
JFormattedTextField src = jFormattedTextField1;
String prevText = src.getText();
if(prevText.length() > 20) {
src.setText(prevText.substring(0, 19));
final JDialog notice = new JDialog(cp, "Notice");
notice.setSize(new Dimension(400, 300));
notice.setLocationRelativeTo(null);
notice.setModal(true);
notice.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
JTextArea noticeLabel = new JTextArea("What you entered into Line 1 of the LED Screen exceeded the maximum 20 characters. The message has been shortened from \"" + prevText + "\" to \""+ src.getText() +".\"");
noticeLabel.setLineWrap(true);
noticeLabel.setWrapStyleWord(true);
noticeLabel.setEditable(false);
JButton okButton = new JButton("Okay");
okButton.setSize(new Dimension(300, 120));
noticeLabel.setSize(new Dimension(350, 60));
noticeLabel.setFont(new java.awt.Font("Times New Roman", java.awt.Font.BOLD, 18));
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
notice.setVisible(false);
}
});
notice.setLayout(new FlowLayout());
notice.add(noticeLabel);
notice.add(okButton);
notice.setVisible(true);
}
}
private void jFormattedTextField2FocusLost(java.awt.event.FocusEvent evt) {
JFormattedTextField src = jFormattedTextField2;
String prevText = src.getText();
if(prevText.length() > 20) {
src.setText(prevText.substring(0, 19));
final JDialog notice = new JDialog(cp, "Notice");
notice.setSize(new Dimension(400, 300));
notice.setLocationRelativeTo(null);
notice.setModal(true);
notice.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
JTextArea noticeLabel = new JTextArea("What you entered into Line 2 of the LED Screen exceeded the maximum 20 characters. The message has been shortened from \"" + prevText + "\" to \""+ src.getText() +".\"");
noticeLabel.setLineWrap(true);
noticeLabel.setWrapStyleWord(true);
noticeLabel.setEditable(false);
JButton okButton = new JButton("Okay");
okButton.setSize(new Dimension(300, 120));
noticeLabel.setSize(new Dimension(350, 60));
noticeLabel.setFont(new java.awt.Font("Times New Roman", java.awt.Font.BOLD, 18));
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
notice.setVisible(false);
}
});
notice.setLayout(new FlowLayout());
notice.add(noticeLabel);
notice.add(okButton);
notice.setVisible(true);
}
}
// Variables declaration - do not modify
private javax.swing.JCheckBox blueLight;
private javax.swing.Box.Filler filler1;
private javax.swing.JCheckBox greenLight;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JFormattedTextField jFormattedTextField1;
private javax.swing.JFormattedTextField jFormattedTextField2;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JInternalFrame jInternalFrame2;
private javax.swing.JInternalFrame jInternalFrame3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JCheckBox redLight;
private javax.swing.JCheckBox whiteLight;
private javax.swing.JCheckBox yellowLight;
// End of variables declaration
private static ControlPanel cp;
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Metal".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ControlPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(ControlPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ControlPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ControlPanel.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
cp = new ControlPanel();
cp.setVisible(true);
cp.setLocationRelativeTo(null);
}
});
}
}
我如何编辑生成的代码?
最佳答案
如果问题仍然存在,您必须在任何文本编辑器中打开 JFrame 类:记事本、Notepad++、写字板等,然后删除错误。然后返回 netbeans 并重新加载您的项目。
要删除表单项,请使用导航器窗口 (Ctl+7) 并安全地删除它们。
关于java - netbeans 生成的代码中生成错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30787091/
我已经使用 vue-cli 两个星期了,直到今天一切正常。我在本地建立这个项目。 https://drive.google.com/open?id=0BwGw1zyyKjW7S3RYWXRaX24tQ
您好,我正在尝试使用 python 库 pytesseract 从图像中提取文本。请找到代码: from PIL import Image from pytesseract import image_
我的错误 /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference
我已经训练了一个模型,我正在尝试使用 predict函数但它返回以下错误。 Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]])
根据Microsoft DataConnectors的信息我想通过 this ODBC driver 创建一个从 PowerBi 到 PostgreSQL 的连接器使用直接查询。我重用了 Micros
我已经为 SoundManagement 创建了一个包,其中有一个扩展 MediaPlayer 的类。我希望全局控制这个变量。这是我的代码: package soundmanagement; impo
我在Heroku上部署了一个应用程序。我正在使用免费服务。 我经常收到以下错误消息。 PG::Error: ERROR: out of memory 如果刷新浏览器,就可以了。但是随后,它又随机发生
我正在运行 LAMP 服务器,这个 .htaccess 给我一个 500 错误。其作用是过滤关键字并重定向到相应的域名。 Options +FollowSymLinks RewriteEngine
我有两个驱动器 A 和 B。使用 python 脚本,我在“A”驱动器中创建一些文件,并运行 powerscript,该脚本以 1 秒的间隔将驱动器 A 中的所有文件复制到驱动器 B。 我在 powe
下面的函数一直返回这个错误信息。我认为可能是 double_precision 字段类型导致了这种情况,我尝试使用 CAST,但要么不是这样,要么我没有做对...帮助? 这是错误: ERROR: i
这个问题已经有答案了: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答) 已关闭
我的数据库有这个小问题。 我创建了一个表“articoli”,其中包含商品的品牌、型号和价格。 每篇文章都由一个 id (ID_ARTICOLO)` 定义,它是一个自动递增字段。 好吧,现在当我尝试插
我是新来的。我目前正在 DeVry 在线学习中级 C++ 编程。我们正在使用 C++ Primer Plus 这本书,到目前为止我一直做得很好。我的老师最近向我们扔了一个曲线球。我目前的任务是这样的:
这个问题在这里已经有了答案: What is an undefined reference/unresolved external symbol error and how do I fix it?
我的网站中有一段代码有问题;此错误仅发生在 Internet Explorer 7 中。 我没有在这里发布我所有的 HTML/CSS 标记,而是发布了网站的一个版本 here . 如您所见,我在列中有
如果尝试在 USB 设备上构建 node.js 应用程序时在我的树莓派上使用 npm 时遇到一些问题。 package.json 看起来像这样: { "name" : "node-todo",
在 Python 中,您有 None单例,在某些情况下表现得很奇怪: >>> a = None >>> type(a) >>> isinstance(a,None) Traceback (most
这是我的 build.gradle (Module:app) 文件: apply plugin: 'com.android.application' android { compileSdkV
我是 android 的新手,我的项目刚才编译和运行正常,但在我尝试实现抽屉导航后,它给了我这个错误 FAILURE: Build failed with an exception. What wen
谁能解释一下?我想我正在做一些非常愚蠢的事情,并且急切地等待着启蒙。 我得到这个输出: phpversion() == 7.2.25-1+0~20191128.32+debian8~1.gbp108
我是一名优秀的程序员,十分优秀!