Komputer Świat Ekspert - Forum: [Java] Prosty kalkulator - Komputer Świat Ekspert - Forum

Skocz do zawartości

Strona 1 z 1

[Java] Prosty kalkulator

#1 Użytkownik nie jest zalogowany   NightTrain 

  • Nowy Uczestnik
  • Grupa: Czytelnicy
  • Postów 303
  • Rejestracja: 24-październik 07

Napisano 13 grudzień 2010, 08:19

Witam!

Napisałem taki prosty programik kalkulator, wszystko działa cacy i wogóle. Chciałbym jednak zastosować w nim klasę dziedziczącą oraz klasę abstrakcyjną- nie wiem chociaż po jednej funkcji dla każdej z tych klas, czy na moim przykładzie moglibyście mi pokazać, gdzie mogę ją zastosować? Nie programuję w Javie,a jest mi to potrzebne.

Wklejam mój kalkulatorek:

public class Calculator extends javax.swing.JFrame {

    /** Creates new form Calculator */
    //zmienne
    double plusminus;
    double firstDouble;
    double secondDouble;
    double totalDouble;

    //sprawdzanie dla przycisnięcia danego buttonika
    int plusClick;
    int minusClick;
    int multiplyClick;
    int divideClick;
    int decimalClick;

    public Calculator() {
        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.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        display = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        clear = new javax.swing.JButton();
        decimal = new javax.swing.JButton();
        plus = new javax.swing.JButton();
        minus = new javax.swing.JButton();
        multiplay = new javax.swing.JButton();
        divide = new javax.swing.JButton();
        posneg = new javax.swing.JButton();
        equals = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Kalkulator v1.0");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        display.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

        jButton1.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton1.setText("1");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton2.setText("2");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton3.setText("3");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton4.setText("4");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton5.setText("5");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton6.setText("6");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton7.setText("7");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jButton8.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton8.setText("8");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jButton9.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton9.setText("9");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        jButton10.setText("0");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        clear.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        clear.setText("C");
        clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearActionPerformed(evt);
            }
        });

        decimal.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        decimal.setText(".");
        decimal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                decimalActionPerformed(evt);
            }
        });

        plus.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        plus.setText("+");
        plus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                plusActionPerformed(evt);
            }
        });

        minus.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        minus.setText("-");
        minus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                minusActionPerformed(evt);
            }
        });

        multiplay.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        multiplay.setText("x");
        multiplay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                multiplayActionPerformed(evt);
            }
        });

        divide.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        divide.setText("/");
        divide.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                divideActionPerformed(evt);
            }
        });

        posneg.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        posneg.setText("+/-");
        posneg.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                posnegActionPerformed(evt);
            }
        });

        equals.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
        equals.setText("=");
        equals.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                equalsActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(multiplay, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(minus, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(equals, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(decimal, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(divide, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                    .addComponent(display, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(plus, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(posneg, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(display, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(plus, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(minus, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(multiplay, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(clear, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(decimal, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(divide, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(posneg, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(equals, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(43, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>                        

    private void clearActionPerformed(java.awt.event.ActionEvent evt) {                                      
      display.setText("");
      decimalClick=0;
    }                                     

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      //display.getText(display.getText()+jButton1);
      display.setText(display.getText()+jButton1.getText());
    }                                        

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton2.getText());
    }                                        

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton3.getText());
    }                                        

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton4.getText());
    }                                        

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton5.getText());
    }                                        

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton6.getText());
    }                                        

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton7.getText());
    }                                        

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton8.getText());
    }                                        

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      display.setText(display.getText()+jButton9.getText());
    }                                        

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {                                          
      display.setText(display.getText()+jButton10.getText());
    }                                         

    private void decimalActionPerformed(java.awt.event.ActionEvent evt) {                                        
      if(decimalClick==0){
         display.setText(display.getText()+decimal.getText()); 
         decimalClick=1;
      }
    }                                       

    private void posnegActionPerformed(java.awt.event.ActionEvent evt) {                                       
      plusminus=(Double.parseDouble(String.valueOf(display.getText())));
      plusminus=plusminus*(-1);
      display.setText(String.valueOf(plusminus));
    }                                      

    private void plusActionPerformed(java.awt.event.ActionEvent evt) {                                     
      firstDouble=(Double.parseDouble(String.valueOf(display.getText())));
      display.setText("");
      plusClick=1;
      decimalClick=0;
    }                                    

    private void minusActionPerformed(java.awt.event.ActionEvent evt) {                                      
      firstDouble=(Double.parseDouble(String.valueOf(display.getText())));
      display.setText("");
      minusClick=1;
      decimalClick=0;
    }                                     

    private void multiplayActionPerformed(java.awt.event.ActionEvent evt) {                                          
      firstDouble=(Double.parseDouble(String.valueOf(display.getText())));
      display.setText("");
      multiplyClick=1;
      decimalClick=0;
    }                                         

    private void divideActionPerformed(java.awt.event.ActionEvent evt) {                                       
      firstDouble=(Double.parseDouble(String.valueOf(display.getText())));
      display.setText("");
      divideClick=1;
      decimalClick=0;
    }                                      

    private void equalsActionPerformed(java.awt.event.ActionEvent evt) {                                       
      secondDouble=(Double.parseDouble(String.valueOf(display.getText())));

      if(plusClick>0){
          totalDouble=firstDouble+secondDouble;
          display.setText((String.valueOf(totalDouble)));
          firstDouble=0;
          secondDouble=0;
          plusClick=0;
      }
      if(minusClick>0){
          totalDouble=firstDouble-secondDouble;
          display.setText((String.valueOf(totalDouble)));
          firstDouble=0;
          secondDouble=0;
          minusClick=0;
    }                                      
      if(multiplyClick>0){
          totalDouble=firstDouble*secondDouble;
          display.setText((String.valueOf(totalDouble)));
          firstDouble=0;
          secondDouble=0;
          multiplyClick=0;
    }
      if(divideClick>0){
          totalDouble=firstDouble/secondDouble;
          display.setText((String.valueOf(totalDouble)));
          firstDouble=0;
          secondDouble=0;
          divideClick=0;
    }
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Calculator().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton clear;
    private javax.swing.JButton decimal;
    private javax.swing.JTextField display;
    private javax.swing.JButton divide;
    private javax.swing.JButton equals;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton minus;
    private javax.swing.JButton multiplay;
    private javax.swing.JButton plus;
    private javax.swing.JButton posneg;
    // End of variables declaration                   

}


Użytkownik NightTrain edytował ten post 14 grudzień 2010, 08:21

0

#0 Bot Reklamowy

  • Grupa: Reklama

#2 Użytkownik nie jest zalogowany   NightTrain 

  • Nowy Uczestnik
  • Grupa: Czytelnicy
  • Postów 303
  • Rejestracja: 24-październik 07

Napisano 14 grudzień 2010, 08:14

zrobiłem drugi plik o nazwie: drugaKlasa:
public class drukaKlasa extends Calculator {
    

}

Chciałbym teraz wykorzystując jakaś zmienną z klasy bazowej "Calculator" stworzyć nowy przycisk np do potęgowania.

Mógłby ktoś pomóc?

Użytkownik NightTrain edytował ten post 14 grudzień 2010, 08:30

0

#0 Bot Reklamowy

  • Grupa: Reklama
Strona 1 z 1


Szybka odpowiedź

  

Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych


Zmień widoczność shoutboxa Shoutbox

wojtek0569  : (01 sierpień 2014 - 19:09) ..
wojtek0569  : (18 lipiec 2014 - 09:01) .
wojtek0569  : (06 lipiec 2014 - 18:21) Gorąco...
wojtek0569  : (17 czerwiec 2014 - 15:00) Proszę zaglądających o nie robienie bałaganu na forum! ;)
wojtek0569  : (17 czerwiec 2014 - 14:59) Dzisiaj znowu musiałem posprzątasz po spamerze.
wojtek0569  : (14 czerwiec 2014 - 10:19) Forum posprzątane z bieżącego spamu (14.06)
OldShaterhan  : (30 maj 2014 - 22:45) dobra, linki nie :D
OldShaterhan  : (30 maj 2014 - 22:45) [url="http://link.pl/"]URLe też[/url]
OldShaterhan  : (30 maj 2014 - 22:45) emotki w SB zaczęły działać? :o
OldShaterhan  : (30 maj 2014 - 22:45) Przydałoby się, ale trzeba by też Buszmena zaciągnąć do roboty... ;)
wojtek0569  : (30 maj 2014 - 22:35) I kwestia... czy sprzątamy dalej w starych tematach?
wojtek0569  : (30 maj 2014 - 22:34) @Old Zamknąłem jeden temat bo tam ciągle jest robiony spam w sygnach. Wchodzę co trzy dni i przeglądam wszystkie nowe posty i usuwam spam.
wojtek0569  : (30 maj 2014 - 21:49) Nie ;) No chyba że Oldowi. Zapadła jakaś decyzja w sprawie tych for i coś jest napisane w majowym KŚ a haw go nie mam o Old i Zielony na przekór nie chcieli mi powiedzieć :D
dawido90  : (28 maj 2014 - 15:33) zapał się kończy? :)
wojtek0569  : (27 maj 2014 - 14:38) Bo ja usuwam tylko nowy spam...
wojtek0569  : (27 maj 2014 - 14:37) @Old To mamy sprzatać dalej czy nie?
wojtek0569  : (27 maj 2014 - 14:32) Ludzie nie róbcie tyle spamu!
wojtek0569  : (23 maj 2014 - 19:34) Ah...
OldShaterhan  : (16 maj 2014 - 09:54) nie patrzałem na to
wojtek0569  : (13 maj 2014 - 14:25) @Old Usunąłem trochę dzisiejszego spamu
Rozszerz pole shoutboxa

DIGDIP