【发布时间】:2013-05-12 02:32:56
【问题描述】:
这是我的代码
public Main_panel() {
initComponents();
setLocationRelativeTo(null);
tf_type.setVisible(false);
String normal = tf_type.getText();
String ntext = "normal";
if(normal.equals(ntext)) {
cmb_report.setVisible(false);
cmb_cu.setVisible(false);
}
对于其他信息,通过 netbeans 中的自定义代码将 tf_type 设置为 public static。但是 cmb_reports 和 cmb_cu 不是不可见的,即不执行 if 语句。这是为什么呢?
【问题讨论】:
标签: java string swing if-statement comparison