You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Zulfi Khan <zu...@yahoo.com.INVALID> on 2024/10/24 01:00:44 UTC
Can't run GUI Program in Apache Netbeans IDE 23- Run File option in Run Menu not enabled
I am trying to runthe GUI program in Apache NetBeans IDE 23 but “Run File” optionin RunMenu is not enabled. NetBeans is also doingbackgroundprocessing. I have uploaded the image here:
https://ibb.co/MZ1Yxb3
The code of Jframeclass is given below:
packagecom.mycompany.projexceldb;
importjavax.swing.*;
/**
*
* @author zulfi
*/
public classExcelDBJFrame extends javax.swing.JFrame {
/**
* Creates newform ExcelDBJFrame
*/
publicExcelDBJFrame() {
initComponents();
}
/**
* This methodis called from within the constructor to initialize the form.
* WARNING: DoNOT modify this code. The content of this method is always
* regeneratedby the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-folddefaultstate="collapsed" desc="Generated Code">
private voidinitComponents() {
jButton1 =new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("ExcelToDB");
jButton1.addActionListener(new java.awt.event.ActionListener() {
publicvoid actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = newjavax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(190, 190, 190)
.addComponent(jButton1)
.addContainerGap(199, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addComponent(jButton1)
.addContainerGap(247, Short.MAX_VALUE))
);
pack();
}//</editor-fold>
private voidjButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO addyour handling code here:
JOptionPane.showMessageDialog(null, "Testing");
}
/**
* @param argsthe command line arguments
*/
public staticvoid main(String args[]) {
/* Set theNimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Lookand feel setting code (optional) ">
/* If Nimbus(introduced in Java SE 6) is not available, stay with the defaultlook and feel.
* Fordetails seehttp://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for(javax.swing.UIManager.LookAndFeelInfo info :javax.swing.UIManager.getInstalledLookAndFeels()) {
if("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch(ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(ExcelDBJFrame.class.getName()).log(java.util.logging.Level.SEVERE,null, ex);
} catch(InstantiationException ex) {
java.util.logging.Logger.getLogger(ExcelDBJFrame.class.getName()).log(java.util.logging.Level.SEVERE,null, ex);
} catch(IllegalAccessException ex) {
java.util.logging.Logger.getLogger(ExcelDBJFrame.class.getName()).log(java.util.logging.Level.SEVERE,null, ex);
} catch(javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(ExcelDBJFrame.class.getName()).log(java.util.logging.Level.SEVERE,null, ex);
}
//</editor-fold>
/* Createand display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
publicvoid run() {
newExcelDBJFrame().setVisible(true);
}
});
}
// Variablesdeclaration - do not modify
privatejavax.swing.JButton jButton1;
// End ofvariables declaration
}
The output of theprogram is:
Scanning forprojects...
---------------------<com.mycompany:ProjExcelDB >----------------------
Building ProjExcelDB1.0-SNAPSHOT
from pom.xml
--------------------------------[jar ]---------------------------------
---resources:3.3.1:resources (default-resources) @ ProjExcelDB ---
skip non existingresourceDirectory/home/zulfi/NetBeansProjects/ProjExcelDB/src/main/resources
---compiler:3.13.0:compile (default-compile) @ ProjExcelDB ---
Nothing to compile -all classes are up to date.
---resources:3.3.1:testResources (default-testResources) @ ProjExcelDB---
skip non existingresourceDirectory/home/zulfi/NetBeansProjects/ProjExcelDB/src/test/resources
---compiler:3.13.0:testCompile (default-testCompile) @ ProjExcelDB ---
No sources tocompile
---surefire:3.2.5:test (default-test) @ ProjExcelDB ---
No tests to run.
--- jar:3.4.1:jar(default-jar) @ ProjExcelDB ---
---install:3.1.2:install (default-install) @ ProjExcelDB ---
Installing/home/zulfi/NetBeansProjects/ProjExcelDB/pom.xml to/home/zulfi/.m2/repository/com/mycompany/ProjExcelDB/1.0-SNAPSHOT/ProjExcelDB-1.0-SNAPSHOT.pom
Installing/home/zulfi/NetBeansProjects/ProjExcelDB/target/ProjExcelDB-1.0-SNAPSHOT.jarto/home/zulfi/.m2/repository/com/mycompany/ProjExcelDB/1.0-SNAPSHOT/ProjExcelDB-1.0-SNAPSHOT.jar
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1.647 s
Finished at:2024-10-23T19:45:39-05:00
------------------------------------------------------------------------