Results 1 to 19 of 19
  1. #1
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Angry Cannot find symbol

    error:
    Java Code:
    Hulpven.java:19: cannot find symbol
    symbol  : method setVisible(boolean)
    location: class Hulpven
             setVisible(true);
             ^
    1 error
    Part of program that the code refers to:
    Java Code:
     public Hulpven(String param) 
          {
             initComponents();
             this.setVisible(true);
          }
    I really do not know what is wrong...PLEASE help!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    What does the Hulpven class extend? Does it extend a class that has a setVisible(boolean) method such as a JPanel or JFrame? If it doesn't, the compiler has no idea what setVisible(true) is trying to do.

  3. #3
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    What does the Hulpven class extend? Does it extend a class that has a setVisible(boolean) method such as a JPanel or JFrame? If it doesn't, the compiler has no idea what setVisible(true) is trying to do.
    Yes it does exstend a program...This one:
    Java Code:
        import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
       import javax.swing.border.*;
    	
    /*
     * Created by JFormDesigner on Sat Oct 30 11:47:07 CAT 2010
     */
    
    
    
    /**
     * @author JJ Minnie
     */
        public class Lone extends JFrame 
       {
         
           public Lone() 
          {
             initComponents();
             this.setVisible(true);
          }
       
          
          
           public static void main(String[]args)
          {
             Lone obj = new Lone();
          }
           private void BerekentotMouseClicked(MouseEvent e) 
          {//totaal1
             double Loonperdag1 = Double.parseDouble(Dagloon.getText());
             double ae1 = Double.parseDouble(dae1.getText());
             double y1 = Double.parseDouble(by1.getText());
             double f1 = Double.parseDouble(af1.getText());
             double btot1 = Loonperdag1*ae1+y1-f1;
             double een = btot1 * 100;
             double een1 = Math.round(een);
             double een2 = een1 / 100;
             String ot1 = "" + een2;
             tot1.setText(ot1);
             //totaal2
             double Loonperdag2 = Double.parseDouble(Dagloon.getText());
             double ae2 = Double.parseDouble(dae2.getText());
             double y2 = Double.parseDouble(by2.getText());
             double f2 = Double.parseDouble(af2.getText());
             double btot2 = Loonperdag2*ae2+y2-f2;
             double twee = btot2 * 100;
             double twee1 = Math.round(twee);
             double twee2 = twee1 / 100;
             String ot2 = "" + twee2;
             tot2.setText(ot2);
             //totaal3
             double Loonperdag3 = Double.parseDouble(Dagloon.getText());
             double ae3 = Double.parseDouble(dae3.getText());
             double y3 = Double.parseDouble(by3.getText());
             double f3 = Double.parseDouble(af3.getText());
             double btot3 = Loonperdag3*ae3+y3-f3;
             double drie = btot3 * 100;
             double drie1 = Math.round(drie);
             double drie2 = drie1 / 100;
             String ot3 = "" + drie2;
             tot3.setText(ot3);
             //totaal4
             double Loonperdag4 = Double.parseDouble(Dagloon.getText());
             double ae4 = Double.parseDouble(dae4.getText());
             double y4 = Double.parseDouble(by4.getText());
             double f4 = Double.parseDouble(af4.getText());
             double btot4 = Loonperdag4*ae4+y4-f4;
             double vier = btot4 * 100;
             double vier1 = Math.round(vier);
             double vier2 = vier1 / 100;
             String ot4 = "" + vier2;
             tot4.setText(ot4);
             //totaal5
             double Loonperdag5 = Double.parseDouble(Dagloon.getText());
             double ae5 = Double.parseDouble(dae5.getText());
             double y5 = Double.parseDouble(by5.getText());
             double f5 = Double.parseDouble(af5.getText());
             double btot5 = Loonperdag5*ae5+y5-f5;
             double vyf = btot5 * 100;
             double vyf1 = Math.round(vyf);
             double vyf2 = vyf1 / 100;
             String ot5 = "" + vyf2;
             tot5.setText(ot5);
           //totaal6 
             double Loonperdag6 = Double.parseDouble(Dagloon.getText());
             double ae6 = Double.parseDouble(dae6.getText());
             double y6 = Double.parseDouble(by6.getText());
             double f6 = Double.parseDouble(af6.getText());
             double btot6 = Loonperdag6*ae6+y6-f6;
             double ses = btot6 * 100;
             double ses1 = Math.round(ses);
             double ses2 = ses1 / 100;
             String ot6 = "" + ses2;
             tot6.setText(ot6);
             //totaal7
             double Loonperdag7 = Double.parseDouble(Dagloon.getText());
             double ae7 = Double.parseDouble(dae7.getText());
             double y7 = Double.parseDouble(by7.getText());
             double f7 = Double.parseDouble(af7.getText());
             double btot7 = Loonperdag7*ae7+y7-f7;
             double sewe = btot7 * 100;
             double sewe1 = Math.round(sewe);
             double sewe2 = sewe1 / 100;
             String ot7 = "" + sewe2;
             tot7.setText(ot7);
             //totaal8
             double Loonperdag8 = Double.parseDouble(Dagloon.getText());
             double ae8 = Double.parseDouble(dae8.getText());
             double y8 = Double.parseDouble(by8.getText());
             double f8 = Double.parseDouble(af8.getText());
             double btot8 = Loonperdag8*ae8+y8-f8;
             double agt = btot8 * 100;
             double agt1 = Math.round(agt);
             double agt2 = agt1 / 100;
             String ot8 = "" + agt2;
             tot8.setText(ot8);
             //totaal9
             double Loonperdag9 = Double.parseDouble(Dagloon.getText());
             double ae9 = Double.parseDouble(dae9.getText());
             double y9 = Double.parseDouble(by9.getText());
             double f9 = Double.parseDouble(af9.getText());
             double btot9 = Loonperdag3*ae9+y9-f9;
             double nege = btot9 * 100;
             double nege1 = Math.round(nege);
             double nege2 = nege1 / 100;
             String ot9 = "" + nege2;
             tot9.setText(ot9);
             //Totaal10
             double Loonperdag10 = Double.parseDouble(Dagloon.getText());
             double ae10 = Double.parseDouble(dae10.getText());
             double y10 = Double.parseDouble(by10.getText());
             double f10 = Double.parseDouble(af10.getText());
             double btot10 = Loonperdag3*ae10+y10-f10;
             double tien = btot10 * 100;
             double tien1 = Math.round(tien);
             double tien2 = tien1 / 100;
             String ot10 = "" + tien2;
             tot10.setText(ot10);
          }
       
           private void BerekenloneMouseClicked(MouseEvent e) 
          {
          //kry user input
             double Loonperdag1 = Double.parseDouble(tot1.getText());
             double Loonperdag2 = Double.parseDouble(tot2.getText());
             double Loonperdag3 = Double.parseDouble(tot3.getText());
             double Loonperdag4 = Double.parseDouble(tot4.getText());
             double Loonperdag5 = Double.parseDouble(tot5.getText());
             double Loonperdag6 = Double.parseDouble(tot6.getText());
             double Loonperdag7 = Double.parseDouble(tot7.getText());
             double Loonperdag8 = Double.parseDouble(tot8.getText());
             double Loonperdag9 = Double.parseDouble(tot9.getText());
             double Loonperdag10 = Double.parseDouble(tot10.getText());
          	//Stuur na klasse
             Bereken1 obj1 = new Bereken1(Loonperdag1);
             Bereken2 obj2 = new Bereken2(Loonperdag2);
             Bereken3 obj3 = new Bereken3(Loonperdag3);
             Bereken4 obj4 = new Bereken4(Loonperdag4);
             Bereken5 obj5 = new Bereken5(Loonperdag5);
             Bereken6 obj6 = new Bereken6(Loonperdag6);
             Bereken7 obj7 = new Bereken7(Loonperdag7);
             Bereken8 obj8 = new Bereken8(Loonperdag8);
             Bereken9 obj9 = new Bereken9(Loonperdag9);
             Bereken10 obj10 = new Bereken10(Loonperdag10);
             //getbereken1 
             int B1100 = obj1.getHonderd();
             int B150 = obj1.getVyftig();
             int B120 = obj1.getTwintig();
             int B110 = obj1.getTien();
             int B15 = obj1.getVyf();
             int B12 = obj1.getTwee();
             int B11 = obj1.getEen();
             double B1S = obj1.getSente();
          	//getbereken2
             int B2100 = obj2.getHonderd();
             int B250 = obj2.getVyftig();
             int B220 = obj2.getTwintig();
             int B210 = obj2.getTien();
             int B25 = obj2.getVyf();
             int B22 = obj2.getTwee();
             int B21 = obj2.getEen();
             double B2S = obj2.getSente();
          	//getbereken3
             int B3100 = obj3.getHonderd();
             int B350 = obj3.getVyftig();
             int B320 = obj3.getTwintig();
             int B310 = obj3.getTien();
             int B35 = obj3.getVyf();
             int B32 = obj3.getTwee();
             int B31 = obj3.getEen();
             double B3S = obj3.getSente();
          	//getbereken4
             int B4100 = obj4.getHonderd();
             int B450 = obj4.getVyftig();
             int B420 = obj4.getTwintig();
             int B410 = obj4.getTien();
             int B45 = obj4.getVyf();
             int B42 = obj4.getTwee();
             int B41 = obj4.getEen();
             double B4S = obj4.getSente();
          	//getbereken5
             int B5100 = obj5.getHonderd();
             int B550 = obj5.getVyftig();
             int B520 = obj5.getTwintig();
             int B510 = obj5.getTien();
             int B55 = obj5.getVyf();
             int B52 = obj5.getTwee();
             int B51 = obj5.getEen();
             double B5S = obj5.getSente();
          	//getbereken6
             int B6100 = obj6.getHonderd();
             int B650 = obj6.getVyftig();
             int B620 = obj6.getTwintig();
             int B610 = obj6.getTien();
             int B65 = obj6.getVyf();
             int B62 = obj6.getTwee();
             int B61 = obj6.getEen();
             double B6S = obj6.getSente();
          	//getbereken7
             int B7100 = obj7.getHonderd();
             int B750 = obj7.getVyftig();
             int B720 = obj7.getTwintig();
             int B710 = obj7.getTien();
             int B75 = obj7.getVyf();
             int B72 = obj7.getTwee();
             int B71 = obj7.getEen();
             double B7S = obj7.getSente();
          	//getbereken8
             int B8100 = obj8.getHonderd();
             int B850 = obj8.getVyftig();
             int B820 = obj8.getTwintig();
             int B810 = obj8.getTien();
             int B85 = obj8.getVyf();
             int B82 = obj8.getTwee();
             int B81 = obj8.getEen();
             double B8S = obj8.getSente();
          	//getbereken9
             int B9100 = obj9.getHonderd();
             int B950 = obj9.getVyftig();
             int B920 = obj9.getTwintig();
             int B910 = obj9.getTien();
             int B95 = obj9.getVyf();
             int B92 = obj9.getTwee();
             int B91 = obj9.getEen();
             double B9S = obj9.getSente();
          	//getbereken10
             int B10100 = obj10.getHonderd();
             int B1050 = obj10.getVyftig();
             int B1020 = obj10.getTwintig();
             int B1010 = obj10.getTien();
             int B105 = obj10.getVyf();
             int B102 = obj10.getTwee();
             int B101 = obj10.getEen();
             double B10S = obj10.getSente();
             //Tel bewerkings op:
          	//Honderdrande
             int res100 = B1100+B2100+B3100+B4100+B5100+B6100+B7100+B8100+B9100+B10100;
             int res50 = B150+B250+B350+B450+B550+B650+B750+B850+B950+B1050;
             int res20 = B120+B220+B320+B420+B520+B620+B720+B820+B920+B1020;
             int res10 = B110+B210+B310+B410+B510+B610+B710+B810+B910+B1010;
             int res5 = B15+B25+B35+B45+B55+B65+B75+B85+B95+B105;
             int res2 = B12+292+B32+B42+B52+B62+B72+B82+B92+B102;
             int res1 = B11+B21+B31+B41+B51+B61+B71+B81+B91+B101;
             double resS = B1S+B2S+B3S+B4S+B5S+B6S+B7S+B8S+B9S+B10S;
             //rond sente af
             double resS0 = resS%1;//resS is the number you want rounded
             double resS1 = resS0 * 100;
             double resS2 = Math.round(resS1);
             double resS3 = resS2 / 100;        
             
             JOptionPane.showMessageDialog(null,"heoveelheid honderdrande:\t"+res100+"\nhoeveelheid vyftigrande:\t"+res50+"\nhoeveelheid twintigrande:\t"+res20+"\nhoeveelheid tienrande:\t"+res10+"\nhoeveelheid vyfrande:\t"+res5+"\nhoeveelheid tweerande:\t"+res2+"\nSente:\t"+resS3);	   
          }
         	
       
       
           private void VeldskoonMouseClicked(MouseEvent e) {
             naam1.setText("");
             naam2.setText("");
             naam3.setText("");
             naam4.setText("");
             naam5.setText("");
             naam6.setText("");
             naam7.setText("");
             naam8.setText("");
             naam9.setText("");
             naam10.setText("");
             dae1.setText("");
             dae2.setText("");
             dae3.setText("");
             dae4.setText("");
             dae5.setText("");
             dae6.setText("");
             dae7.setText("");
             dae8.setText("");
             dae9.setText("");
             dae10.setText("");
             by1.setText("");
             by2.setText("");
             by4.setText("");
             by3.setText("");
             by5.setText("");
             by6.setText("");
             by7.setText("");
             by8.setText("");
             by9.setText("");
             by10.setText("");
             af1.setText("");
             af2.setText("");
             af3.setText("");
             af4.setText("");
             af5.setText("");
             af6.setText("");
             af7.setText("");
             af8.setText("");
             af9.setText("");
             af10.setText("");
             tot1.setText("");
             tot2.setText("");
             tot3.setText("");
             tot4.setText("");
             tot5.setText("");
             tot6.setText("");
             tot7.setText("");
             tot8.setText("");
             tot9.setText("");
             tot10.setText("");
          }
          
           public void okButtonMouseClicked(MouseEvent e)
          {
             int answer = JOptionPane.showConfirmDialog(null, "Wil U die program weer begin?\nDo you want to restart the program?");
             if (answer == JOptionPane.YES_OPTION) {
             // User clicked YES.
                naam1.setText("");
                naam2.setText("");
                naam3.setText("");
                naam4.setText("");
                naam5.setText("");
                naam6.setText("");
                naam7.setText("");
                naam8.setText("");
                naam9.setText("");
                naam10.setText("");
                dae1.setText("");
                dae2.setText("");
                dae3.setText("");
                dae4.setText("");
                dae5.setText("");
                dae6.setText("");
                dae7.setText("");
                dae8.setText("");
                dae9.setText("");
                dae10.setText("");
                by1.setText("");
                by2.setText("");
                by4.setText("");
                by3.setText("");
                by5.setText("");
                by6.setText("");
                by7.setText("");
                by8.setText("");
                by9.setText("");
                by10.setText("");
                af1.setText("");
                af2.setText("");
                af3.setText("");
                af4.setText("");
                af5.setText("");
                af6.setText("");
                af7.setText("");
                af8.setText("");
                af9.setText("");
                af10.setText("");
                tot1.setText("");
                tot2.setText("");
                tot3.setText("");
                tot4.setText("");
                tot5.setText("");
                tot6.setText("");
                tot7.setText("");
                tot8.setText("");
                tot9.setText("");
                tot10.setText("");
                Dag.setText("");
                Maand.setText("");
                Jaar.setText("");
                Dagloon.setText(""); 
             } 
             else if (answer == JOptionPane.NO_OPTION) {
             // User clicked NO.
                System.exit (0);
             }	
          }
       
           private void helpButtonMouseClicked(MouseEvent e)
          {
             Hulpven hul = new Hulpven("");
             hul.setVisible(true); 
          }
       
           private void AfrikaansMouseClicked(MouseEvent e) {
             Ldatum.setText("Datum:");
             Ljaar.setText("JJJJ");
             Ldagloon.setText("Loon per dag:");
             Lnaam.setText("Naam en van");
             Laantaldae.setText("Aantal dae");
             Lgewerk.setText("gewerk");
             Lbyvoegings.setText("Byvoegings");
             Ltotaal.setText("Totaal");
             Veldskoon.setText("Wis velde uit");
             Berekenlone.setText("Bereken lone");
             okButton.setText("Verlaat");
             helpButton.setText("Hulp");
             Laftrekkings.setText("Aftrekkings");
             Ldagloon.setText("Loon per dag: R");
             Berekentot.setText("Bereken totaal");
             Sakrekenaar.setText("Sakrekenaar");
             Engels.setText("English");
          }
       
           private void EngelsMouseClicked(MouseEvent e) {
             Ldatum.setText("   Date:");
             Ljaar.setText("YYYY");
             Ldagloon.setText("Wage per day");
             Lnaam.setText("Name and surname");
             Laantaldae.setText("  Days");
             Lgewerk.setText("worked");
             Lbyvoegings.setText("Additions");
             Ltotaal.setText("Total");
             Veldskoon.setText("Clear fields");
             Berekenlone.setText("Calculate wages");
             okButton.setText("Exit");
             helpButton.setText("Help");
             Laftrekkings.setText("Deductions");
             Ldagloon.setText("Wage per day R");
             Berekentot.setText("Calculate total");
             Sakrekenaar.setText("Calculator");
             Engels.setText("Engels");
          }
       
           private void SakrekenaarMouseClicked(MouseEvent e) 
          {
             Calculator cal = new Calculator("");
             cal.pack();
             cal.setVisible(true); 
              		  
          }
       
       
       	   
           private void initComponents() {
          // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
          // Generated using JFormDesigner non-commercial license
             dialogPane = new JPanel();
             contentPanel = new JPanel();
             Ldatum = new JLabel();
             Dag = new JTextField();
             Maand = new JTextField();
             Jaar = new JTextField();
             Ldag = new JLabel();
             Lmaand = new JLabel();
             Ljaar = new JLabel();
             Ldagloon = new JLabel();
             Dagloon = new JTextField();
             Lnaam = new JLabel();
             Laantaldae = new JLabel();
             Lbyvoegings = new JLabel();
             Laftrekkings = new JLabel();
             Lgewerk = new JLabel();
             naam1 = new JTextField();
             naam2 = new JTextField();
             naam3 = new JTextField();
             naam4 = new JTextField();
             naam5 = new JTextField();
             naam6 = new JTextField();
             naam7 = new JTextField();
             naam8 = new JTextField();
             naam9 = new JTextField();
             naam10 = new JTextField();
             dae1 = new JTextField();
             dae2 = new JTextField();
             dae3 = new JTextField();
             dae4 = new JTextField();
             dae5 = new JTextField();
             dae6 = new JTextField();
             dae7 = new JTextField();
             dae8 = new JTextField();
             dae9 = new JTextField();
             dae10 = new JTextField();
             by1 = new JTextField();
             by2 = new JTextField();
             by3 = new JTextField();
             by4 = new JTextField();
             by5 = new JTextField();
             by6 = new JTextField();
             by7 = new JTextField();
             by8 = new JTextField();
             by9 = new JTextField();
             by10 = new JTextField();
             af1 = new JTextField();
             af2 = new JTextField();
             af3 = new JTextField();
             af4 = new JTextField();
             af5 = new JTextField();
             af6 = new JTextField();
             af7 = new JTextField();
             af8 = new JTextField();
             af9 = new JTextField();
             af10 = new JTextField();
             Ltotaal = new JLabel();
             tot1 = new JTextField();
             tot2 = new JTextField();
             tot3 = new JTextField();
             tot4 = new JTextField();
             tot5 = new JTextField();
             tot6 = new JTextField();
             tot7 = new JTextField();
             tot8 = new JTextField();
             tot9 = new JTextField();
             tot10 = new JTextField();
             Berekentot = new JButton();
             Berekenlone = new JButton();
             Veldskoon = new JButton();
             separator2 = new JSeparator();
             okButton = new JButton();
             helpButton = new JButton();
             Afrikaans = new JButton();
             Engels = new JButton();
             Sakrekenaar = new JButton();
             label15 = new JLabel();
          
          //======== this ========
             setTitle("Inligting invoering");
             Container contentPane = getContentPane();
             contentPane.setLayout(new BorderLayout());
          
          //======== dialogPane ========
             {
                dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
                dialogPane.setLayout(new BorderLayout());
             
             //======== contentPanel ========
                {
                   contentPanel.setLayout(null);
                
                //---- Ldatum ----
                   Ldatum.setText("Datum:");
                   contentPanel.add(Ldatum);
                   Ldatum.setBounds(105, 5, Ldatum.getPreferredSize().width, 19);
                   contentPanel.add(Dag);
                   Dag.setBounds(145, 5, 40, Dag.getPreferredSize().height);
                   contentPanel.add(Maand);
                   Maand.setBounds(195, 5, 40, Maand.getPreferredSize().height);
                   contentPanel.add(Jaar);
                   Jaar.setBounds(245, 5, 40, Jaar.getPreferredSize().height);
                
                //---- Ldag ----
                   Ldag.setText(" DD");
                   contentPanel.add(Ldag);
                   Ldag.setBounds(new Rectangle(new Point(155, 25), Ldag.getPreferredSize()));
                
                //---- Lmaand ----
                   Lmaand.setText(" MM");
                   contentPanel.add(Lmaand);
                   Lmaand.setBounds(new Rectangle(new Point(205, 25), Lmaand.getPreferredSize()));
                
                //---- Ljaar ----
                   Ljaar.setText("JJJJ");
                   contentPanel.add(Ljaar);
                   Ljaar.setBounds(new Rectangle(new Point(255, 25), Ljaar.getPreferredSize()));
                
                //---- Ldagloon ----
                   Ldagloon.setText("Loon per dag:  R");
                   contentPanel.add(Ldagloon);
                   Ldagloon.setBounds(5, 35, Ldagloon.getPreferredSize().width, 19);
                   contentPanel.add(Dagloon);
                   Dagloon.setBounds(95, 35, 60, Dagloon.getPreferredSize().height);
                
                //---- Lnaam ----
                   Lnaam.setText("Naam en van");
                   contentPanel.add(Lnaam);
                   Lnaam.setBounds(20, 75, 120, Lnaam.getPreferredSize().height);
                
                //---- Laantaldae ----
                   Laantaldae.setText("Aantal dae");
                   contentPanel.add(Laantaldae);
                   Laantaldae.setBounds(new Rectangle(new Point(150, 65), Laantaldae.getPreferredSize()));
                
                //---- Lbyvoegings ----
                   Lbyvoegings.setText("Byvoegings");
                   contentPanel.add(Lbyvoegings);
                   Lbyvoegings.setBounds(new Rectangle(new Point(215, 75), Lbyvoegings.getPreferredSize()));
                
                //---- Laftrekkings ----
                   Laftrekkings.setText("Aftrekkings");
                   contentPanel.add(Laftrekkings);
                   Laftrekkings.setBounds(new Rectangle(new Point(285, 75), Laftrekkings.getPreferredSize()));
                
                //---- Lgewerk ----
                   Lgewerk.setText("gewerk");
                   contentPanel.add(Lgewerk);
                   Lgewerk.setBounds(160, 75, 50, Lgewerk.getPreferredSize().height);
                   contentPanel.add(naam1);
                   naam1.setBounds(15, 95, 125, 20);
                   contentPanel.add(naam2);
                   naam2.setBounds(15, 120, 125, 20);
                   contentPanel.add(naam3);
                   naam3.setBounds(15, 145, 125, 20);
                   contentPanel.add(naam4);
                   naam4.setBounds(15, 170, 125, 20);
                   contentPanel.add(naam5);
                   naam5.setBounds(15, 195, 125, 20);
                   contentPanel.add(naam6);
                   naam6.setBounds(15, 220, 125, 20);
                   contentPanel.add(naam7);
                   naam7.setBounds(15, 245, 125, 20);
                   contentPanel.add(naam8);
                   naam8.setBounds(15, 270, 125, 20);
                   contentPanel.add(naam9);
                   naam9.setBounds(15, 295, 125, 20);
                   contentPanel.add(naam10);
                   naam10.setBounds(15, 320, 125, 20);
                   contentPanel.add(dae1);
                   dae1.setBounds(155, 95, 50, dae1.getPreferredSize().height);
                   contentPanel.add(dae2);
                   dae2.setBounds(155, 120, 50, 20);
                   contentPanel.add(dae3);
                   dae3.setBounds(155, 145, 50, 20);
                   contentPanel.add(dae4);
                   dae4.setBounds(155, 170, 50, 20);
                   contentPanel.add(dae5);
                   dae5.setBounds(155, 195, 50, 20);
                   contentPanel.add(dae6);
                   dae6.setBounds(155, 220, 50, 20);
                   contentPanel.add(dae7);
                   dae7.setBounds(155, 245, 50, 20);
                   contentPanel.add(dae8);
                   dae8.setBounds(155, 270, 50, 20);
                   contentPanel.add(dae9);
                   dae9.setBounds(155, 295, 50, 20);
                   contentPanel.add(dae10);
                   dae10.setBounds(155, 320, 50, 20);
                   contentPanel.add(by1);
                   by1.setBounds(220, 95, 50, 20);
                   contentPanel.add(by2);
                   by2.setBounds(220, 120, 50, 20);
                   contentPanel.add(by3);
                   by3.setBounds(220, 145, 50, 20);
                   contentPanel.add(by4);
                   by4.setBounds(220, 170, 50, 20);
                   contentPanel.add(by5);
                   by5.setBounds(220, 195, 50, 20);
                   contentPanel.add(by6);
                   by6.setBounds(220, 220, 50, 20);
                   contentPanel.add(by7);
                   by7.setBounds(220, 245, 50, 20);
                   contentPanel.add(by8);
                   by8.setBounds(220, 270, 50, 20);
                   contentPanel.add(by9);
                   by9.setBounds(220, 295, 50, 20);
                   contentPanel.add(by10);
                   by10.setBounds(220, 320, 50, 20);
                   contentPanel.add(af1);
                   af1.setBounds(285, 95, 50, 20);
                   contentPanel.add(af2);
                   af2.setBounds(285, 120, 50, 20);
                   contentPanel.add(af3);
                   af3.setBounds(285, 145, 50, 20);
                   contentPanel.add(af4);
                   af4.setBounds(285, 170, 50, 20);
                   contentPanel.add(af5);
                   af5.setBounds(285, 195, 50, 20);
                   contentPanel.add(af6);
                   af6.setBounds(285, 220, 50, 20);
                   contentPanel.add(af7);
                   af7.setBounds(285, 245, 50, 20);
                   contentPanel.add(af8);
                   af8.setBounds(285, 270, 50, 20);
                   contentPanel.add(af9);
                   af9.setBounds(285, 295, 50, 20);
                   contentPanel.add(af10);
                   af10.setBounds(285, 320, 50, 20);
                
                //---- Ltotaal ----
                   Ltotaal.setText("Totaal");
                   contentPanel.add(Ltotaal);
                   Ltotaal.setBounds(new Rectangle(new Point(355, 75), Ltotaal.getPreferredSize()));
                   contentPanel.add(tot1);
                   tot1.setBounds(350, 95, 50, 20);
                   contentPanel.add(tot2);
                   tot2.setBounds(350, 120, 50, 20);
                   contentPanel.add(tot3);
                   tot3.setBounds(350, 145, 50, 20);
                   contentPanel.add(tot4);
                   tot4.setBounds(350, 170, 50, 20);
                   contentPanel.add(tot5);
                   tot5.setBounds(350, 195, 50, 20);
                   contentPanel.add(tot6);
                   tot6.setBounds(350, 220, 50, 20);
                   contentPanel.add(tot7);
                   tot7.setBounds(350, 245, 50, 20);
                   contentPanel.add(tot8);
                   tot8.setBounds(350, 270, 50, 20);
                   contentPanel.add(tot9);
                   tot9.setBounds(350, 295, 50, 20);
                   contentPanel.add(tot10);
                   tot10.setBounds(350, 320, 50, 20);
                
                //---- Berekentot ----
                   Berekentot.setText("Bereken totaal");
                   Berekentot.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               BerekentotMouseClicked(e);
                            }
                         });
                   contentPanel.add(Berekentot);
                   Berekentot.setBounds(275, 345, 125, Berekentot.getPreferredSize().height);
                
                //---- Berekenlone ----
                   Berekenlone.setText("Bereken lone");
                   Berekenlone.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               BerekenloneMouseClicked(e);
                            }
                         });
                   contentPanel.add(Berekenlone);
                   Berekenlone.setBounds(85, 380, 243, 38);
                
                //---- Veldskoon ----
                   Veldskoon.setText("Wis velde uit");
                   Veldskoon.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               VeldskoonMouseClicked(e);
                            }
                         });
                   contentPanel.add(Veldskoon);
                   Veldskoon.setBounds(15, 345, 130, Veldskoon.getPreferredSize().height);
                   contentPanel.add(separator2);
                   separator2.setBounds(0, 60, 415, 5);
                
                //---- okButton ----
                   okButton.setText("Verlaat");
                   okButton.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               okButtonMouseClicked(e);
                            }
                         });
                   contentPanel.add(okButton);
                   okButton.setBounds(245, 440, 80, okButton.getPreferredSize().height);
                
                //---- helpButton ----
                   helpButton.setText("Hulp");
                   helpButton.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               helpButtonMouseClicked(e);
                            }
                         });
                   contentPanel.add(helpButton);
                   helpButton.setBounds(330, 440, 80, helpButton.getPreferredSize().height);
                
                //---- Afrikaans ----
                   Afrikaans.setText("Afrikaans");
                   Afrikaans.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               AfrikaansMouseClicked(e);
                            }
                         });
                   contentPanel.add(Afrikaans);
                   Afrikaans.setBounds(5, 440, 90, Afrikaans.getPreferredSize().height);
                
                //---- Engels ----
                   Engels.setText("English");
                   Engels.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               EngelsMouseClicked(e);
                            }
                         });
                   contentPanel.add(Engels);
                   Engels.setBounds(105, 440, 90, Engels.getPreferredSize().height);
                
                //---- Sakrekenaar ----
                   Sakrekenaar.setText("Sakrekenaar");
                   Sakrekenaar.addMouseListener(
                          new MouseAdapter() {
                             @Override
                             public void mouseClicked(MouseEvent e) {
                               SakrekenaarMouseClicked(e);
                            }
                         });
                   contentPanel.add(Sakrekenaar);
                   Sakrekenaar.setBounds(new Rectangle(new Point(155, 345), Sakrekenaar.getPreferredSize()));
                
                //---- label15 ----
                   label15.setText("text");
                   label15.setIcon(new ImageIcon("C:\\Documents and Settings\\Jonannes van Zyl\\My Documents\\IT\\pat taak 2010\\Fase 3\\lawninsky1680x1050tl6.jpg"));
                   contentPanel.add(label15);
                   label15.setBounds(0, 0, 415, 470);
                
                   { // compute preferred size
                      Dimension preferredSize = new Dimension();
                      for(int i = 0; i < contentPanel.getComponentCount(); i++) {
                         Rectangle bounds = contentPanel.getComponent(i).getBounds();
                         preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                         preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                      }
                      Insets insets = contentPanel.getInsets();
                      preferredSize.width += insets.right;
                      preferredSize.height += insets.bottom;
                      contentPanel.setMinimumSize(preferredSize);
                      contentPanel.setPreferredSize(preferredSize);
                   }
                }
                dialogPane.add(contentPanel, BorderLayout.CENTER);
             }
             contentPane.add(dialogPane, BorderLayout.CENTER);
             pack();
             setLocationRelativeTo(getOwner());
          // JFormDesigner - End of component initialization  //GEN-END:initComponents
          }
       
       // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
       // Generated using JFormDesigner non-commercial license
          private JPanel dialogPane;
          private JPanel contentPanel;
          private JLabel Ldatum;
          private JTextField Dag;
          private JTextField Maand;
          private JTextField Jaar;
          private JLabel Ldag;
          private JLabel Lmaand;
          private JLabel Ljaar;
          private JLabel Ldagloon;
          private JTextField Dagloon;
          private JLabel Lnaam;
          private JLabel Laantaldae;
          private JLabel Lbyvoegings;
          private JLabel Laftrekkings;
          private JLabel Lgewerk;
          private JTextField naam1;
          private JTextField naam2;
          private JTextField naam3;
          private JTextField naam4;
          private JTextField naam5;
          private JTextField naam6;
          private JTextField naam7;
          private JTextField naam8;
          private JTextField naam9;
          private JTextField naam10;
          private JTextField dae1;
          private JTextField dae2;
          private JTextField dae3;
          private JTextField dae4;
          private JTextField dae5;
          private JTextField dae6;
          private JTextField dae7;
          private JTextField dae8;
          private JTextField dae9;
          private JTextField dae10;
          private JTextField by1;
          private JTextField by2;
          private JTextField by3;
          private JTextField by4;
          private JTextField by5;
          private JTextField by6;
          private JTextField by7;
          private JTextField by8;
          private JTextField by9;
          private JTextField by10;
          private JTextField af1;
          private JTextField af2;
          private JTextField af3;
          private JTextField af4;
          private JTextField af5;
          private JTextField af6;
          private JTextField af7;
          private JTextField af8;
          private JTextField af9;
          private JTextField af10;
          private JLabel Ltotaal;
          private JTextField tot1;
          private JTextField tot2;
          private JTextField tot3;
          private JTextField tot4;
          private JTextField tot5;
          private JTextField tot6;
          private JTextField tot7;
          private JTextField tot8;
          private JTextField tot9;
          private JTextField tot10;
          private JButton Berekentot;
          private JButton Berekenlone;
          private JButton Veldskoon;
          private JSeparator separator2;
          private JButton okButton;
          private JButton helpButton;
          private JButton Afrikaans;
          private JButton Engels;
          private JButton Sakrekenaar;
          private JLabel label15;
       // JFormDesigner - End of variables declaration  //GEN-END:variables
       }
    Its just funny caus it worked earlier. What should I do?

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    That code (for class Lone) is not what the compiler message is referring to. It is referring to something in class Hulpven (intended as a dialog showing help?).

  5. #5
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by pbrockway2 View Post
    That code (for class Lone) is not what the compiler message is referring to. It is referring to something in class Hulpven (intended as a dialog showing help?).
    Oh sorry! here is the Hulpven program:
    Java Code:
       import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
    
    /*
     * Created by JFormDesigner on Mon Nov 08 11:03:49 CAT 2010
     */
    
    
    
    /**
     * @author JJ Minnie
     */
        public class Hulpven 
       {
           public Hulpven(String param) 
          {
             initComponents();
             this.setVisible(true);
          }
           public static void main(String[]args)
          {
             Hulpven objh = new Hulpven();
          }
           public Hulpven() 
          {
             this("DEFAULT");
          }
       
           private void AfrikaansMouseClicked(MouseEvent e) 
    		 {
            
          }
       
           private void EngelsMouseClicked(MouseEvent e) {
             Hulp.setTitle("Hulp");
          }
       
       
           private void initComponents() {
          // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
          // Generated using JFormDesigner non-commercial license
             Hulp = new JFrame();
             panel = new JTabbedPane();
             Oorsig = new JPanel();
             label11 = new JLabel();
             label12 = new JLabel();
             label13 = new JLabel();
             label14 = new JLabel();
             label15 = new JLabel();
             label16 = new JLabel();
             label17 = new JLabel();
             label18 = new JLabel();
             label19 = new JLabel();
             label20 = new JLabel();
             Invoering = new JPanel();
             label21 = new JLabel();
             label22 = new JLabel();
             label23 = new JLabel();
             label24 = new JLabel();
             label25 = new JLabel();
             label26 = new JLabel();
             label27 = new JLabel();
             label28 = new JLabel();
             label29 = new JLabel();
             Knoppies = new JPanel();
             label30 = new JLabel();
             label31 = new JLabel();
             label32 = new JLabel();
             label33 = new JLabel();
             label34 = new JLabel();
             label35 = new JLabel();
             label36 = new JLabel();
             label37 = new JLabel();
             label38 = new JLabel();
             label39 = new JLabel();
             label40 = new JLabel();
             label41 = new JLabel();
             Bibliografie = new JPanel();
             label42 = new JLabel();
             label43 = new JLabel();
             Afrikaans = new JButton();
             Engels = new JButton();
          
          //======== Hulp ========
             {
                Hulp.setTitle("Hulp");
                Container HulpContentPane = Hulp.getContentPane();
                HulpContentPane.setLayout(null);
             
             //======== panel ========
                {
                
                //======== Oorsig ========
                   {
                      Oorsig.setLayout(null);
                   
                   //---- label11 ----
                      label11.setText("Tik al die gevraagde inligting in, in die gevraagde velde.  Klik dan op die bereken totaal knoppie ");
                      Oorsig.add(label11);
                      label11.setBounds(0, 0, 555, 14);
                   
                   //---- label12 ----
                      label12.setText("om die totaal te bereken wat in die totaalkolom sal verskyn.  U kan dan die bereken lone knoppie ");
                      Oorsig.add(label12);
                      label12.setBounds(0, 19, 555, 14);
                   
                   //---- label13 ----
                      label13.setText("druk om die lone te bereken wat die finale produk is.  U word ook die keuses gegee van taal ");
                      Oorsig.add(label13);
                      label13.setBounds(0, 38, 555, 14);
                   
                   //---- label14 ----
                      label14.setText("(Engels en Afrikaans), om die inligting in die velde uit te wis (wis velde uit), die program te ");
                      Oorsig.add(label14);
                      label14.setBounds(0, 57, 555, 14);
                   
                   //---- label15 ----
                      label15.setText("verlaat of oor te begin (verlaat) en om vir hulp te vra soos U gedoen het (hulp).  Let asseblief op ");
                      Oorsig.add(label15);
                      label15.setBounds(0, 76, 555, 14);
                   
                   //---- label16 ----
                      label16.setText("die volgende:");
                      Oorsig.add(label16);
                      label16.setBounds(0, 95, 555, 14);
                   
                   //---- label17 ----
                      label17.setText("1.  Alle le\u00eb moet gevul word met \u2018n nul (0).");
                      Oorsig.add(label17);
                      label17.setBounds(0, 114, 555, 14);
                   
                   //---- label18 ----
                      label18.setText("2.  As U reeds die totale het is dit nie nodig om al die velde in te vul nie maar slegs die ");
                      Oorsig.add(label18);
                      label18.setBounds(0, 133, 555, 14);
                   
                   //---- label19 ----
                      label19.setText("totaalkolom in te vul om die lone te bereken.  Die velde hoef dan ook nie deur \u2018n nul gevul te ");
                      Oorsig.add(label19);
                      label19.setBounds(0, 152, 555, 14);
                   
                   //---- label20 ----
                      label20.setText("word nie.");
                      Oorsig.add(label20);
                      label20.setBounds(0, 171, 555, 14);
                   
                      { // compute preferred size
                         Dimension preferredSize = new Dimension();
                         for(int i = 0; i < Oorsig.getComponentCount(); i++) {
                            Rectangle bounds = Oorsig.getComponent(i).getBounds();
                            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                         }
                         Insets insets = Oorsig.getInsets();
                         preferredSize.width += insets.right;
                         preferredSize.height += insets.bottom;
                         Oorsig.setMinimumSize(preferredSize);
                         Oorsig.setPreferredSize(preferredSize);
                      }
                   }
                   panel.addTab("Oorsig     ", Oorsig);
                
                
                //======== Invoering ========
                   {
                      Invoering.setLayout(null);
                   
                   //---- label21 ----
                      label21.setText("Datum :  Tik die datum in, in die formaat wat gegee is, bv. 13- vir die dag 04- vir die maand ");
                      Invoering.add(label21);
                      label21.setBounds(0, 0, 555, 14);
                   
                   //---- label22 ----
                      label22.setText("2010-vir die jaar.  Loon per  dag:  Die loon wat U werknemers per dag betaal word.  Die naam en ");
                      Invoering.add(label22);
                      label22.setBounds(0, 19, 555, 14);
                   
                   //---- label23 ----
                      label23.setText("van, aantal dae gewerk, byvoegings en aftrekkings word elk onder die gegewe opskrif in getik.  ");
                      Invoering.add(label23);
                      label23.setBounds(0, 38, 555, 14);
                   
                   //---- label24 ----
                      label24.setText("Dit is egter nie \u2018n noodsaaklikheid om die naam en van kolom te voltooi nie aangesien dit net vir ");
                      Invoering.add(label24);
                      label24.setBounds(0, 57, 555, 14);
                   
                   //---- label25 ----
                      label25.setText("U persoonlike boekhouding is.  ");
                      Invoering.add(label25);
                      label25.setBounds(0, 76, 555, 14);
                   
                   //---- label26 ----
                      label26.setText("Die totaalkolom velde moet oopgelos word aangesien die program self die totaal bereken, maar ");
                      Invoering.add(label26);
                      label26.setBounds(0, 95, 555, 14);
                   
                   //---- label27 ----
                      label27.setText("totale kan ook self ingetik word vir vinniger berekening van lone, slaan die knoppies afdeling na ");
                      Invoering.add(label27);
                      label27.setBounds(0, 114, 555, 14);
                   
                   //---- label28 ----
                      label28.setText("vir meer inligting hieroor.  Let daarop dat alle le\u00eb velde met \u2018n nul (0) gevul moet word behalwe ");
                      Invoering.add(label28);
                      label28.setBounds(0, 133, 555, 14);
                   
                   //---- label29 ----
                      label29.setText("die naam en van kolom, anders gaan die berekeninge nie werk nie.");
                      Invoering.add(label29);
                      label29.setBounds(0, 152, 555, 14);
                   
                      { // compute preferred size
                         Dimension preferredSize = new Dimension();
                         for(int i = 0; i < Invoering.getComponentCount(); i++) {
                            Rectangle bounds = Invoering.getComponent(i).getBounds();
                            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                         }
                         Insets insets = Invoering.getInsets();
                         preferredSize.width += insets.right;
                         preferredSize.height += insets.bottom;
                         Invoering.setMinimumSize(preferredSize);
                         Invoering.setPreferredSize(preferredSize);
                      }
                   }
                   panel.addTab("Invoering", Invoering);
                
                
                //======== Knoppies ========
                   {
                      Knoppies.setLayout(null);
                   
                   //---- label30 ----
                      label30.setText("Wis velde uit:     Dit wis al die inligting in die velde uit behalwe in die datum en loon per dag veld.");
                      Knoppies.add(label30);
                      label30.setBounds(0, 0, 555, 14);
                   
                   //---- label31 ----
                      label31.setText("Sakrekenaar:     Die knoppie gee U die opsie om \u2018n sakrekenaar te gebruik vir eie berekeninge.  ");
                      Knoppies.add(label31);
                      label31.setBounds(0, 19, 555, 14);
                   
                   //---- label32 ----
                      label32.setText("Bereken totaal:  Dit bereken die totaal van al die inligting wat U in die velde ingetik het.  Bereken ");
                      Knoppies.add(label32);
                      label32.setBounds(0, 38, 555, 14);
                   
                   //---- label33 ----
                      label33.setText("lone:                     Dit bereken die lone en is die finale produk.  As U werknemers \u2018n vaste bedrag ");
                      Knoppies.add(label33);
                      label33.setBounds(0, 57, 555, 14);
                   
                   //---- label34 ----
                      label34.setText("                              per week betaal word en U wil nie deur die proses gaan om al die velde in te ");
                      Knoppies.add(label34);
                      label34.setBounds(0, 76, 555, 14);
                   
                   //---- label35 ----
                      label35.setText("                              vul nie, kan U net die totaalkolom invul aangesien die bereken lone knoppie ");
                      Knoppies.add(label35);
                      label35.setBounds(0, 95, 555, 14);
                   
                   //---- label36 ----
                      label36.setText("                              net die inligting in die totaalkolom gebruik.");
                      Knoppies.add(label36);
                      label36.setBounds(0, 114, 555, 14);
                   
                   //---- label37 ----
                      label37.setText("Afrikaans:           Gee U die taalkeuse van Afrikaans.");
                      Knoppies.add(label37);
                      label37.setBounds(0, 133, 555, 14);
                   
                   //---- label38 ----
                      label38.setText("English:               Gee U die taalkeuse van Engels.");
                      Knoppies.add(label38);
                      label38.setBounds(0, 152, 555, 14);
                   
                   //---- label39 ----
                      label39.setText("Verlaat:               Gee U die keuse om die program weer te begin of te verlaat.  Om die program ");
                      Knoppies.add(label39);
                      label39.setBounds(0, 171, 555, 14);
                   
                   //---- label40 ----
                      label40.setText("                              te verlaat sal beteken dat al die inligting in die velde uitgewis sal word.");
                      Knoppies.add(label40);
                      label40.setBounds(0, 190, 555, 14);
                   
                   //---- label41 ----
                      label41.setText("Hulp:                     Maak die huidige venster oop.");
                      Knoppies.add(label41);
                      label41.setBounds(0, 209, 555, 14);
                   
                      { // compute preferred size
                         Dimension preferredSize = new Dimension();
                         for(int i = 0; i < Knoppies.getComponentCount(); i++) {
                            Rectangle bounds = Knoppies.getComponent(i).getBounds();
                            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                         }
                         Insets insets = Knoppies.getInsets();
                         preferredSize.width += insets.right;
                         preferredSize.height += insets.bottom;
                         Knoppies.setMinimumSize(preferredSize);
                         Knoppies.setPreferredSize(preferredSize);
                      }
                   }
                   panel.addTab("Knoppies   ", Knoppies);
                
                
                //======== Bibliografie ========
                   {
                      Bibliografie.setLayout(null);
                   
                   //---- label42 ----
                      label42.setText("Program inligting");
                      Bibliografie.add(label42);
                      label42.setBounds(0, 0, 555, 14);
                   
                   //---- label43 ----
                      label43.setText("Ontwikkelaar:   Johannes van Zyl ");
                      Bibliografie.add(label43);
                      label43.setBounds(0, 19, 555, 14);
                   
                      { // compute preferred size
                         Dimension preferredSize = new Dimension();
                         for(int i = 0; i < Bibliografie.getComponentCount(); i++) {
                            Rectangle bounds = Bibliografie.getComponent(i).getBounds();
                            preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                            preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                         }
                         Insets insets = Bibliografie.getInsets();
                         preferredSize.width += insets.right;
                         preferredSize.height += insets.bottom;
                         Bibliografie.setMinimumSize(preferredSize);
                         Bibliografie.setPreferredSize(preferredSize);
                      }
                   }
                   panel.addTab("Bibliografie  ", Bibliografie);
                
                }
                HulpContentPane.add(panel);
                panel.setBounds(0, 0, 570, 305);
             
             //---- Afrikaans ----
                Afrikaans.setText("Afrikaans");
                Afrikaans.addMouseListener(
                       new MouseAdapter() {
                          @Override
                          public void mouseClicked(MouseEvent e) {
                            AfrikaansMouseClicked(e);
                         }
                      });
                HulpContentPane.add(Afrikaans);
                Afrikaans.setBounds(5, 315, 95, Afrikaans.getPreferredSize().height);
             
             //---- Engels ----
                Engels.setText("English");
                Engels.addMouseListener(
                       new MouseAdapter() {
                          @Override
                          public void mouseClicked(MouseEvent e) {
                            EngelsMouseClicked(e);
                         }
                      });
                HulpContentPane.add(Engels);
                Engels.setBounds(110, 315, 95, Engels.getPreferredSize().height);
             
                { // compute preferred size
                   Dimension preferredSize = new Dimension();
                   for(int i = 0; i < HulpContentPane.getComponentCount(); i++) {
                      Rectangle bounds = HulpContentPane.getComponent(i).getBounds();
                      preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                      preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                   }
                   Insets insets = HulpContentPane.getInsets();
                   preferredSize.width += insets.right;
                   preferredSize.height += insets.bottom;
                   HulpContentPane.setMinimumSize(preferredSize);
                   HulpContentPane.setPreferredSize(preferredSize);
                }
                Hulp.pack();
                Hulp.setLocationRelativeTo(Hulp.getOwner());
             }
          // JFormDesigner - End of component initialization  //GEN-END:initComponents
          }
       
       // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
       // Generated using JFormDesigner non-commercial license
          private JFrame Hulp;
          private JTabbedPane panel;
          private JPanel Oorsig;
          private JLabel label11;
          private JLabel label12;
          private JLabel label13;
          private JLabel label14;
          private JLabel label15;
          private JLabel label16;
          private JLabel label17;
          private JLabel label18;
          private JLabel label19;
          private JLabel label20;
          private JPanel Invoering;
          private JLabel label21;
          private JLabel label22;
          private JLabel label23;
          private JLabel label24;
          private JLabel label25;
          private JLabel label26;
          private JLabel label27;
          private JLabel label28;
          private JLabel label29;
          private JPanel Knoppies;
          private JLabel label30;
          private JLabel label31;
          private JLabel label32;
          private JLabel label33;
          private JLabel label34;
          private JLabel label35;
          private JLabel label36;
          private JLabel label37;
          private JLabel label38;
          private JLabel label39;
          private JLabel label40;
          private JLabel label41;
          private JPanel Bibliografie;
          private JLabel label42;
          private JLabel label43;
          private JButton Afrikaans;
          private JButton Engels;
       // JFormDesigner - End of variables declaration  //GEN-END:variables
       }
    Thanks!

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    OK. So you have to go back and address Fubarable's questions about the Hulpven class: either to fix that class, or ask Fubarable what he was talking about.

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    As I suspected, the class doesn't extend any Swing component so the compiler can't understand what setVisible means. This is one reason I strongly urge you not to use code generation software such as NetBeans drag-and-drop Swing editor, but instead learn to code Swing by hand. Otherwise you're making code without understanding what you are doing.

  8. #8
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    As I suspected, the class doesn't extend any Swing component so the compiler can't understand what setVisible means. This is one reason I strongly urge you not to use code generation software such as NetBeans drag-and-drop Swing editor, but instead learn to code Swing by hand. Otherwise you're making code without understanding what you are doing.
    Oh ok thanx. I was using JFrom designer. How do I fix it?

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Johanis View Post
    Oh ok thanx. I was using JFrom designer. How do I fix it?
    What is Hulpven supposed to be? A JDialog? A JFrame? A JPanel? You'll need to decide and then have this class extend one of these so that setVisible(true) makes sense.

  10. #10
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    What is Hulpven supposed to be? A JDialog? A JFrame? A JPanel? You'll need to decide and then have this class extend one of these so that setVisible(true) makes sense.
    A panel...)

  11. #11
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    AAAAH thanx it works!! Thank you...AGAIN Fubarable! :)
    And thank you pbrockway2 for explaining! :)

  12. #12
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    NO WAIT!! it still doesn't work. It compiles and then runs the whole time but doesn't give me my window!!

  13. #13
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    A JPanel isn't a "window" or top-level container. Rather it's a panel that is ultimately held by a top-level container such as a JFrame or JDialog (and I think you should be using a JDialog for this window).

  14. #14
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    It only gives me a extremely small window....I do not know what I am doing wrong.
    Java Code:
    import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
    
        public class Hulpven extends JFrame {
           public Hulpven(String param) 
          {
             initComponents();
             this.setVisible(true);
          }
           public static void main(String[]args)
          {
             Hulpven objh = new Hulpven();
          }
           public Hulpven() 
          {
             this("DEFAULT");
          }

  15. #15
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Hulpven is now a frame - but it has nothing in it! The initComponents() methods sets all sorts of things up but it adds components to a JFrame called Hulp.

    Perhaps the constructor should call Hulp.setVisible() rather than this.setVisible(). In that case you could remove the "hul.setVisible(true)" line in the other class, as merely creating a new Hulpven will make it visible. But this is just speculation as there really is too much code here (for me at least) and I know nothing about JFormDesigner and how it expects the components it creates to be used by other code.

    Fubarable mentioned above that you should abandon this code and learn Swing - the technology that JFormDesigner is using. Well, he said he suggests... But I'll second the suggestion and add that learning Swing is what you should do.

    This is a tough response as it means putting aside what you've done until it can be done properly.

    Is there some reason for using JFormCreator? Like is it part of a course or something? If it is part of a course then your teacher would be the best person to ask about the problem. Or if this product maintains a help forum that would be the place to go.

  16. #16
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Default

    Quote Originally Posted by pbrockway2 View Post
    Hulpven is now a frame - but it has nothing in it! The initComponents() methods sets all sorts of things up but it adds components to a JFrame called Hulp.

    Perhaps the constructor should call Hulp.setVisible() rather than this.setVisible(). In that case you could remove the "hul.setVisible(true)" line in the other class, as merely creating a new Hulpven will make it visible. But this is just speculation as there really is too much code here (for me at least) and I know nothing about JFormDesigner and how it expects the components it creates to be used by other code.

    Fubarable mentioned above that you should abandon this code and learn Swing - the technology that JFormDesigner is using. Well, he said he suggests... But I'll second the suggestion and add that learning Swing is what you should do.

    This is a tough response as it means putting aside what you've done until it can be done properly.

    Is there some reason for using JFormCreator? Like is it part of a course or something? If it is part of a course then your teacher would be the best person to ask about the problem. Or if this product maintains a help forum that would be the place to go.
    Thanx pbrockway2, its perfecto! We were given an assignment (PAT task, I'm from South Africa) that counts 1/4 of our end year marks. Since I only stated with programming this year we haven't even got to GUI (only JOptionPane Dialogs). So our teacher said here's a program to help you. But he didn't even know how to use the program yet. So we were left in the sand to figure things out for ourselves. So I can't just leave it aside, I have to finish it!
    Thanx for everything!

    Johanis:)

  17. #17
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    OK.

    I'm glad you've got it displaying something. I'm not nearly as proficient as many here with swing stuff. So when I say that half-@ssed attempts at gui interfaces are a recipe for ongoing grief, I *know* what I'm talking about. But you've got to do what you've got to do. So good luck.

    -----

    A totally different matter:

    Java Code:
    double een = btot1 * 100;
    double een1 = Math.round(een);
    double een2 = een1 / 100;
    String ot1 = "" + een2;
    tot1.setText(ot1);

    That's wrong. It should be:

    Java Code:
    tot1.setText(String.format("%.2f", een));

    Think of the lines of code you'll save!

    But there's a more principled reason for doing it this way. What you are trying to do is format a numeric quantity: that is make a human readable string that represents the number. The multiply-round-divide dance does something similar in mathematics (it causes the decimal expansion of the number to end in an infinite sequence of zeros). But that's mathematics and this is programming. And you have to deal with doubles having finite precision and finite range (they only get so big) with all sorts of complications, compromises and arbitrary rules that result: complications that don't arise in mathematics.

    Better to use the built in formatting method. In this case string's format() mehod. See format()'s API docs and the links from there for an explanation of the %.2f stuff.

    (And if that code was generated by the gui designer, then it's cr@p)

    Again, good luck.

  18. #18
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Post

    Quote Originally Posted by pbrockway2 View Post
    OK.

    I'm glad you've got it displaying something. I'm not nearly as proficient as many here with swing stuff. So when I say that half-@ssed attempts at gui interfaces are a recipe for ongoing grief, I *know* what I'm talking about. But you've got to do what you've got to do. So good luck.

    -----

    A totally different matter:

    Java Code:
    double een = btot1 * 100;
    double een1 = Math.round(een);
    double een2 = een1 / 100;
    String ot1 = "" + een2;
    tot1.setText(ot1);

    That's wrong. It should be:

    Java Code:
    tot1.setText(String.format("%.2f", een));

    Think of the lines of code you'll save!

    But there's a more principled reason for doing it this way. What you are ....

    Again, good luck.
    THANK YOU! that does save a lot of lines of code! I did not know that there is a way like that to do it. You see, I posted a thread in which I ask how to round a number to two decimal places, and that was the best feedback I got, so no the gui designer didn't write it (LOL for that!). But that is a much better way of doing it, and you can use the format things for allot of stuff!

    Again thanks for all the >>LECTURES<< it really thought me a lot!

    Johanis:D

  19. #19
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    THANK YOU! that does save a lot of lines of code!
    You're welcome.

Similar Threads

  1. Cannot find symbol
    By Johanis in forum New To Java
    Replies: 19
    Last Post: 11-04-2010, 09:13 PM
  2. Can not find symbol ???
    By AliceNewbie in forum New To Java
    Replies: 1
    Last Post: 02-17-2010, 02:44 AM
  3. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 01:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 09:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 09:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •