943,852 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 7562
  • Java RSS
Jun 17th, 2007
0

how to make standalone code out of NetBeans IDE

Expand Post »
I copy and paste code generated from NetBeans into a java file. To run it, I got message "package org.jdesktop.layout does not exit"

What should I do?
Thanks ahead.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dajiebuda is offline Offline
8 posts
since Jun 2007
Jun 17th, 2007
0

Re: how to make standalone code out of NetBeans IDE

can you share your code please?
well, even without looking at your code, it seems that you're just trying to access package that's not there.. so i guess you need to either create that package.. or... delete that line (in the beginning of the codes)
Last edited by ProgrammersTalk; Jun 17th, 2007 at 11:07 pm.
Reputation Points: 21
Solved Threads: 7
Junior Poster in Training
ProgrammersTalk is offline Offline
83 posts
since Jun 2007
Jun 18th, 2007
0

Re: how to make standalone code out of NetBeans IDE

Here is the code. It works within netBeans. If I run it in the command window with javac, I get message "package org.jdesktop.layout does not exist"


public class report2 extends javax.swing.JFrame {

/** Creates new form report2 */
public report2() {
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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
displayDrawing = new javax.swing.JPanel();
infoOutput = new javax.swing.JPanel();
triggerMatrix = new javax.swing.JToggleButton();
triggerInclusion = new javax.swing.JToggleButton();
startCalculation = new javax.swing.JToggleButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("AvantFGM");
displayDrawing.setBackground(new java.awt.Color(51, 51, 51));
org.jdesktop.layout.GroupLayout displayDrawingLayout = new org.jdesktop.layout.GroupLayout(displayDrawing);
displayDrawing.setLayout(displayDrawingLayout);
displayDrawingLayout.setHorizontalGroup(
displayDrawingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 351, Short.MAX_VALUE)
);
displayDrawingLayout.setVerticalGroup(
displayDrawingLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 279, Short.MAX_VALUE)
);

infoOutput.setBackground(new java.awt.Color(255, 255, 255));
infoOutput.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.MatteBorder(null), "Info & Output"));
org.jdesktop.layout.GroupLayout infoOutputLayout = new org.jdesktop.layout.GroupLayout(infoOutput);
infoOutput.setLayout(infoOutputLayout);
infoOutputLayout.setHorizontalGroup(
infoOutputLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 86, Short.MAX_VALUE)
);
infoOutputLayout.setVerticalGroup(
infoOutputLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 128, Short.MAX_VALUE)
);

triggerMatrix.setText("Matrix");
triggerMatrix.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
triggerMatrixActionPerformed(evt);
}
});

triggerInclusion.setText("Inclusion");
triggerInclusion.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
triggerInclusionActionPerformed(evt);
}
});

startCalculation.setText("Calculate");
startCalculation.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startCalculationActionPerformed(evt);
}
});

jMenu1.setText("File");
jMenuBar1.add(jMenu1);

jMenu2.setText("Option");
jMenuBar1.add(jMenu2);

jMenu3.setText("Help");
jMenuBar1.add(jMenu3);

setJMenuBar(jMenuBar1);

org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(displayDrawing, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(triggerMatrix, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(infoOutput, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(triggerInclusion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(startCalculation, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(triggerMatrix, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(triggerInclusion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(startCalculation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(infoOutput, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(displayDrawing, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>

private void startCalculationActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void triggerInclusionActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void triggerMatrixActionPerformed(java.awt.event.ActionEvent evt) {
// report2_2();
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new report2().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JPanel displayDrawing;
private javax.swing.JPanel infoOutput;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JToggleButton startCalculation;
private javax.swing.JToggleButton triggerInclusion;
private javax.swing.JToggleButton triggerMatrix;
// End of variables declaration

}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dajiebuda is offline Offline
8 posts
since Jun 2007
Jun 18th, 2007
0

Re: how to make standalone code out of NetBeans IDE

dajiebuda do not do double posting! Stick to the original post and do not spread chaos over forum. I told you where you can find information to setup CLASSPATH and you should follow them. Why? Because if the not let you have NetBeans you would not know how to run simple Hello.java program from command line...
Copy and Pate is not solution to learn programming language
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 873
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: null value
Next Thread in Java Forum Timeline: Java rmi-ps help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC