Reputation: 3341
Hej all,
Yesterday before finishing my work I build up my project in NetBeans and saved it. Today when I got up and open project, I got a warning like this: http://imageshack.us/photo/my-images/812/problemez.png/.
What can I do in order to recover my GUI form? now my GUI is just in read-only mode, what is totally useless ...
Thanks!
OK I have done it finally. For those of you who would find similar problem: 1. Create new GUI JFrame form in the same project. 2. Copy all the compoments from the previous JFRame form(in read-only mode) into the new one 3. There will be automatically created new code, now correctly. 4. Just copy all your code into the new form code.
Upvotes: 7
Views: 8590
Reputation: 31
Right-click on the Form object in Navigator, and click Reload form.
Upvotes: 1
Reputation: 295
Editing the .java to add the missing NetBeans comments, as suggested by Angelo Fuchs seems to be easier than creating a new frame.
Here is how to "repair" the variable declaration bloc and the generated event methods:
// <editor-fold defaultstate="collapsed" desc=" Variables declaration - do not modify ">
// Variables declaration - do not modify//GEN-BEGIN:variables
private JPanel jPanelChart;
private JSlider jSliderThickness;
// End of variables declaration//GEN-END:variables
//</editor-fold>
and
private void jSliderThicknessStateChanged(ChangeEvent evt) {//GEN-FIRST:event_jSliderThicknessStateChanged
stroke = jSliderThickness.getValue() * 0.01f;
renderer.setSeriesStroke(0, new BasicStroke(stroke));
}//GEN-LAST:event_jSliderThicknessStateChanged
Upvotes: 1
Reputation: 805
create new Jframe
and in Jframe Navigator
of NetBeans copy all component in previous Jframe
to new Jframe
Upvotes: 0
Reputation: 3341
For those of you who would find similar problem:
JFrame
form in the same project. JFrame
form(in read-only mode) into the new oneUpvotes: 10
Reputation: 9941
most likely you removed the parts that say 'generated code here'
(the lines look like this:
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
...
}// </editor-fold>//GEN-END:initComponents
recreate them. And be aware that there are more than just the ones for initComponents.
Upvotes: 4