jak uzywac repaint(); ?? obciaza procka w 100%

0

POMOCY!! mam problem jak odswiezac wykres bo jak uzywam repaint(); to obciaza mi procka na 100%, i wszystko muli. ponizej umiescilem fragment kodu (aplet z zakladkami)

  public void paintComponent(Graphics g ) {
           super.paintComponent(g);
       double y = 0;
       double z=1;
       double b = 0;

if (typFunkcji == "Mostek"){

                    //osie cha-yka wejsciowa
                g.setColor(Color.BLACK);
                g.drawLine(0, 100, 200, 100);
                g.drawLine(21, 40, 21, 150);
                g.drawLine(21,40,18,45);
                g.drawLine(21,40,24,45);
                g.drawLine(200,100,195,103);
                g.drawLine(200,100,195,97);

                    //osie cha-yka wyjsciowa

                g.drawLine(0, 210, 200, 210);
                g.drawLine(21, 155, 21, 220);
                g.drawLine(21,155,18,160);
                g.drawLine(21,155,24,160);
                g.drawLine(200,210,195,213);
                g.drawLine(200,210,195,207);
                Image rys5 = getImage(getDocumentBase(),"ug.jpg");
                g.drawImage(rys5, 29,33, this);
                Image rys6 = getImage(getDocumentBase(),"ul.jpg");
                g.drawImage(rys6, 29,148, this);
                g.setColor(Color.GREEN);
              for (double x = 0; x < 189; x += 0.1) {                
                y = (Math.sin(x * fps3/20) * fps2*5 + 100);
               g.drawLine((int) x, (int) y, (int) x, (int) y);

                 }
                 g.setColor(Color.RED);
                  for (double a = 0; a < 189; a += 0.1) {

                    b = (Math.sin(a * fps3/20) * fps2*5 +210);           

               if(b>=210)
                {   b = 210+ (210-(Math.sin(a * fps3/20) * fps2*5 +210));
                g.drawLine((int) a, (int) b, (int) a, (int) b);}
                else {b = (Math.sin(a * fps3/20) * fps2*5 +210);
                g.drawLine((int) a, (int) b, (int) a, (int) b);}

                  }
                  Image rys4 = getImage(getDocumentBase(),"mostek.jpg");
                g.drawImage(rys4, 20,230, null);

         repaint();     

            }

..........................

0

Metoda repaint wywołuję medotdę paintComponent, a więc u Ciebie jest nieskończona pętla, bo na końcu metody paintComponent wywołujesz repaint co wywołuje metodę paintComponent i tak w kółko.
Metode repaint wywołuj w sytuacjach, gdy zmieniło sie coś w komponęcie, który rysujesz, ale poza metodą paintComponet, ta metoda rysuje komponent a repaint wywołuje żądanie ponownego odrysowania.

Pozdrawiam BookaYashee

0

ale jak odswiezac wrescie wykres????? bo jak reguluje suwakami wykres ma mi sie zmienic. gdzie mam dac repaint(); gdzie mam ja wywolac. ponizej jest caly kod aplteu z zakladkami

public class projekt extends JApplet {
TextArea pole, pole2;
JLabel suwLabel, suw2Label, suw3Label, suw4Label,suw5Label, suw6Label,suw7Label,suw8Label;
private JTabbedPane jtabpane;
JSlider suw, suw2, suw3, suw4, suw5, suw6, suw7, suw8;
int fps =0, fps2=3, fps3=3, fps4 ,fps5, fps6=1, fps7, fps8;
public void init() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
//cp.setBackground(Color.white);
// Box bv -Box.createVerticalBox();
int iks, igrek;
iks = getSize().width;
igrek = getSize().height;
jtabpane = new JTabbedPane();

    JPanel pusty = new JPanel();
    pusty.add(new JLabel("Pu?ciutko"));
    JPanel zakladka1 = new JPanel();
    JPanel zakladka2 = new JPanel();
    JPanel zakladka4 = new JPanel(new BorderLayout());
    JPanel wew1 = new JPanel(new GridLayout(1,4));
    JPanel wew2 = new JPanel(new GridLayout(2,2));
    //zakladka3.setLayout(new BoxLayout(zakladka3,10 ));
    //zakladka.add(suw, BorderLayout.NORTH);
    zakladka1.add( new Funkcja("Dioda"));
    zakladka1.add(pole);

    zakladka2.add( new Funkcja("Mostek"));
    zakladka2.add(pole2);
    zakladka2.add(suw2);
    zakladka2.add(suw2Label);
    zakladka2.add(suw3);
    zakladka2.add(suw3Label);

    wew1.add(suw4);
    wew1.add(suw7);

    wew2.add(suw5);
    wew2.add(suw8);
    wew2.add(suw6);

    zakladka4.add( new Funkcja("tranzystor"),BorderLayout.CENTER);
    zakladka4.add(wew1, BorderLayout.NORTH);
    zakladka4.add(wew2, BorderLayout.SOUTH);
   // jtabpane.addTab("Pusty", pusty);
    jtabpane.addTab("DIODA", zakladka1);
    jtabpane.addTab("MOSTEK", zakladka2);
    jtabpane.addTab("TRANZYSTOR opis", pusty);
    jtabpane.addTab("TRANZYSTOR cha-ki", zakladka4);
    jtabpane.addTab("WZMACNIACZ", new Funkcja("wzmacniacz"));

    cp.add(jtabpane);

    setSize(700, 500);// ustalmy poczatkowy rozmiar appletu

}

// class SliderListener implements ChangeListener {

class Funkcja extends JPanel  
                                 {
    private String typFunkcji;

     int[] diod_x1 = {
         0,8,16,24,32,40,48,56,64,72,80,88,96,104,108,111,113,114,115,116,117,118,119,120,121,122,123,124,125,126 };

         int[] diod_y1 ={
         152,152,152,151,151,151,151,151,151,151,151,151,150,149,146,144,140,135,130,125,120,113,106,99,92,85,78,71,63,56};

       // char wejsciowa
         int[] tran_x1 = {30,33,37,40, 44,47,51,53, 57,60,64,67, 70,74,77,81, 85,88,92,95, 99,102,108,115, 126,129,130,130

         };
         int[]tran_y1 = {160,160,160,159, 159,159,158,158, 158,157,157,157, 156,156,156,155, 155,154,154,153, 152,151,148,142, 120,85,63,30 

         };
         // char. wyjsciowe
         //640mV
         int[] tran_x2 ={30,32,40,50,60,70,80,90,100,110,120,130

         };

         int[] tran_y2 = {310,296,295,294,293,292,291,290,289,288,287,286

         };
         //660mV
         int[] tran_x3 ={30,34,42,51,60,70,80,90,100,110,120,130

         };

         int[] tran_y3 = {310,281,280,279,278,277,276,275,274,273,272,271

         };
         //680mV
          int[] tran_x4 ={30,36,44,52,61,70,80,90,100,110,120,130

         };

         int[] tran_y4 = {310,251,250,249,248,247,246,245,244,243,242,241

         };
         //700mV
           int[] tran_x5 ={30,38,42,54,63,72,81,90,100,110,120,130

         };

         int[] tran_y5 = {310,210,206,204,202,200,198,196,194,192,190,188

         };

         //char przejsciowa

          int[] tran_x6 = {390,393,397,400, 404,407,411,413, 417,420,424,427, 430,434,437,441, 445,448,452,455, 459,462,468,475, 486,489,490,490

         };
         int[]tran_y6 = {160,160,160,159, 159,159,158,158, 158,157,157,157, 156,156,156,155, 155,154,154,153, 152,151,148,142, 120,85,63,30 

         };

         //char ic = f(ib)

         int[] tran_x7 ={390,403,416,429,442,455,468,481,494,507

         };

         int[] tran_y7 = {305,292,279,266,253,240,227,215,204,196

         };

    public Funkcja(String typ) {
        typFunkcji = typ;

        //setBackground(Color.white);
      setPreferredSize(new Dimension(220, 340));

    suw = new JSlider(0,0,30,0);
    suw.setMajorTickSpacing(3);
//  suw.setMinorTickSpacing(0);
    suw.setPaintTicks(true);
//Create the label table.
    Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();

    labelTable.put( new Integer( 0 ), new JLabel("-5") );
    labelTable.put( new Integer( 3 ), new JLabel("-4") );
    labelTable.put( new Integer( 6 ), new JLabel("-3") );
    labelTable.put( new Integer( 9 ), new JLabel("-2") );
    labelTable.put( new Integer( 12 ), new JLabel("-1") );
    labelTable.put( new Integer( 15 ), new JLabel("0") );
    labelTable.put( new Integer( 18 ), new JLabel("1") );
    labelTable.put( new Integer( 21 ), new JLabel("2") );
    labelTable.put( new Integer( 24 ), new JLabel("3") );
    labelTable.put( new Integer( 27 ), new JLabel("4") );
    labelTable.put( new Integer( 30 ), new JLabel("5V") );
    suw.setLabelTable( labelTable );
    suw.setPaintLabels(true);
    suw.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

       suw2 = new JSlider(0,0,9,3);
    suw2.setMajorTickSpacing(1);
//  suw2.setMinorTickSpacing(0);
    suw2.setPaintTicks(true);
    suw2Label = new JLabel("Amplituda");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable2 = new Hashtable<Integer, JLabel>();

    labelTable2.put( new Integer( 0 ), new JLabel("0") );
    labelTable2.put( new Integer( 1 ), new JLabel("2") );
    labelTable2.put( new Integer( 2 ), new JLabel("4") );
    labelTable2.put( new Integer( 3 ), new JLabel("6") );
    labelTable2.put( new Integer( 4 ), new JLabel("8") );
    labelTable2.put( new Integer( 5 ), new JLabel("10") );
    labelTable2.put( new Integer( 6 ), new JLabel("12") );
    labelTable2.put( new Integer( 7 ), new JLabel("14") );
    labelTable2.put( new Integer( 8 ), new JLabel("16") );
    labelTable2.put( new Integer( 9 ), new JLabel("18V") );
//  labelTable2.put( new Integer( 10 ), new JLabel("20V") );
    suw2.setLabelTable( labelTable2 );
    suw2.setPaintLabels(true);
    suw2.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps2 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

     suw3 = new JSlider(0,1,6,3);
    suw3.setMajorTickSpacing(1);
//  suw3.setMinorTickSpacing(0);
    suw3.setPaintTicks(true);
    suw3Label = new JLabel("Okres");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable3 = new Hashtable<Integer, JLabel>();

    labelTable3.put( new Integer( 0 ), new JLabel("12") );
    labelTable3.put( new Integer( 1 ), new JLabel("10") );
    labelTable3.put( new Integer( 2 ), new JLabel("8") );
    labelTable3.put( new Integer( 3 ), new JLabel("6") );
    labelTable3.put( new Integer( 4 ), new JLabel("4") );
    labelTable3.put( new Integer( 5 ), new JLabel("2") );
    labelTable3.put( new Integer( 6 ), new JLabel("1us") );
//  labelTable3.put( new Integer( 7 ), new JLabel("14V") );
//  labelTable2.put( new Integer( 8 ), new JLabel("16") );
//  labelTable2.put( new Integer( 9 ), new JLabel("18") );
//  labelTable2.put( new Integer( 10 ), new JLabel("20V") );
    suw3.setLabelTable( labelTable3 );
    suw3.setPaintLabels(true);
    suw3.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps3 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

    suw4 = new JSlider(0,0,28,1);
    suw4.setMajorTickSpacing(2);
//  suw4.setMinorTickSpacing(0);
    suw4.setPaintTicks(true);
    suw4Label = new JLabel("UBE");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable4 = new Hashtable<Integer, JLabel>();

    labelTable4.put( new Integer( 0 ), new JLabel("0") );
    labelTable4.put( new Integer( 4 ), new JLabel("0.1") );
    labelTable4.put( new Integer( 8 ), new JLabel("0.2") );
    labelTable4.put( new Integer( 12 ), new JLabel("0.3") );
    labelTable4.put( new Integer( 16 ), new JLabel("0.4") );
    labelTable4.put( new Integer( 20 ), new JLabel("0.5") );
    labelTable4.put( new Integer( 24 ), new JLabel("0.6") );
    labelTable4.put( new Integer( 28), new JLabel("0.7V Ube") );
//  labelTable4.put( new Integer( 8 ), new JLabel("16") );
//  labelTable4.put( new Integer( 9 ), new JLabel("18") );
//  labelTable4.put( new Integer( 10 ), new JLabel("20V") );
    suw4.setLabelTable( labelTable4 );
    suw4.setPaintLabels(true);
    suw4.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps4 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

    suw5 = new JSlider(0,0,12,1);
    suw5.setMajorTickSpacing(1);
//  suw5.setMinorTickSpacing(0);
    suw5.setPaintTicks(true);
    suw5Label = new JLabel("Uce");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable5 = new Hashtable<Integer, JLabel>();

    labelTable5.put( new Integer( 0 ), new JLabel("0") );
    labelTable5.put( new Integer( 2 ), new JLabel("1.5") );
    labelTable5.put( new Integer( 4 ), new JLabel("3") );
    labelTable5.put( new Integer( 6 ), new JLabel("4.5") );
    labelTable5.put( new Integer( 8 ), new JLabel("6") );
    labelTable5.put( new Integer( 10 ), new JLabel("7.5") );
    labelTable5.put( new Integer( 12), new JLabel("9V Uce") );
//  labelTable5.put( new Integer( 8 ), new JLabel("16") );
//  labelTable5.put( new Integer( 9 ), new JLabel("18") );
//  labelTable5.put( new Integer( 10 ), new JLabel("20V") );
    suw5.setLabelTable( labelTable5 );
    suw5.setPaintLabels(true);
    suw5.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps5 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

       suw6 = new JSlider(0,1,4,1);
    suw6.setMajorTickSpacing(1);
//  suw6.setMinorTickSpacing(0);
    suw6.setPaintTicks(true);
    suw6Label = new JLabel("UBE");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable6 = new Hashtable<Integer, JLabel>();

    labelTable6.put( new Integer( 1 ), new JLabel("640") );
    labelTable6.put( new Integer( 2 ), new JLabel("660") );
    labelTable6.put( new Integer( 3 ), new JLabel("680") );
    labelTable6.put( new Integer( 4 ), new JLabel("700mV Ube") );
//  labelTable6.put( new Integer( 16 ), new JLabel("0.4") );
//  labelTable6.put( new Integer( 20 ), new JLabel("0.5") );
//  labelTable6.put( new Integer( 24 ), new JLabel("0.6") );
//  labelTable6.put( new Integer( 28), new JLabel("0.7V") );
//  labelTable6.put( new Integer( 8 ), new JLabel("16") );
//  labelTable6.put( new Integer( 9 ), new JLabel("18") );
//  labelTable6.put( new Integer( 10 ), new JLabel("20V") );
    suw6.setLabelTable( labelTable6 );
    suw6.setPaintLabels(true);
    suw6.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps6 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

       suw7 = new JSlider(0,0,28,1);
    suw7.setMajorTickSpacing(2);
//  suw7.setMinorTickSpacing(0);
    suw7.setPaintTicks(true);
    suw7Label = new JLabel("Uce");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable7 = new Hashtable<Integer, JLabel>();

    labelTable7.put( new Integer( 0 ), new JLabel("0") );
    labelTable7.put( new Integer( 4 ), new JLabel("0.1") );
    labelTable7.put( new Integer( 8 ), new JLabel("0.2") );
    labelTable7.put( new Integer( 12 ), new JLabel("0.3") );
    labelTable7.put( new Integer( 16 ), new JLabel("0.4") );
    labelTable7.put( new Integer( 20 ), new JLabel("0.5") );
    labelTable7.put( new Integer( 24 ), new JLabel("0.6") );
    labelTable7.put( new Integer( 28), new JLabel("0.7V Ube") );
//  labelTable7.put( new Integer( 8 ), new JLabel("16") );
//  labelTable7.put( new Integer( 9 ), new JLabel("18") );
//  labelTable7.put( new Integer( 10 ), new JLabel("20V") );
    suw7.setLabelTable( labelTable7 );
    suw7.setPaintLabels(true);
    suw7.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps7 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});

    suw8 = new JSlider(0,0,10,1);
    suw8.setMajorTickSpacing(1);
//  suw8.setMinorTickSpacing(0);
    suw8.setPaintTicks(true);
//  suw8Label = new JLabel("UBE");
//Create the label table.
    Hashtable<Integer, JLabel> labelTable8 = new Hashtable<Integer, JLabel>();

    labelTable8.put( new Integer( 0 ), new JLabel("0") );
    labelTable8.put( new Integer( 2 ), new JLabel("0.1uA") );
    labelTable8.put( new Integer( 4 ), new JLabel("1uA") );
    labelTable8.put( new Integer( 6 ), new JLabel("10uA") );
    labelTable8.put( new Integer( 8 ), new JLabel("100uA") );
    labelTable8.put( new Integer( 10 ), new JLabel("1mA Ib") );
//  labelTable8.put( new Integer( 6 ), new JLabel("0.6") );
//  labelTable8.put( new Integer( 7), new JLabel("0.7V") );
//  labelTable8.put( new Integer( 8 ), new JLabel("16") );
//  labelTable8.put( new Integer( 9 ), new JLabel("18") );
//  labelTable8.put( new Integer( 10 ), new JLabel("20V") );
    suw8.setLabelTable( labelTable8 );
    suw8.setPaintLabels(true);
    suw8.addChangeListener(new ChangeListener(){

    public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
        fps8 =(int)source.getValue();
       // if (fps !=0) rysuj();

        }
    }});
    }

    public void paintComponent(Graphics g ) {
           super.paintComponent(g);
       double y = 0;
       double z=1;
       double b = 0;
       long tm =10;
      // double x;

        //g.setColor(Color.BLACK);
       // for (double x = 0; x < 500; x += 0.1) {

            if (typFunkcji == "Dioda")
            {
                //osie
                g.setColor(Color.BLACK);
                g.drawLine(100, 50, 100, 250);
                g.drawLine(0, 150, 150, 150);
                g.drawLine(100,50,97,55);
                g.drawLine(100,50,103,55);
                g.drawLine(150,150,145,153);
                g.drawLine(150,150,145,147);
                //przeciecie uf if
                g.drawLine(112,155,112,140);
                g.drawLine(95,140,112,140);
                Image rys = getImage(getDocumentBase(),"id.jpg");
                g.drawImage(rys, 106,50, this);
                Image rys2 = getImage(getDocumentBase(),"uk.jpg");
                g.drawImage(rys2, 140,130, this);
                Image rys3 = getImage(getDocumentBase(),"dioda.jpg");
                g.drawImage(rys3, 10,255, this);
                Image rys7 = getImage(getDocumentBase(),"uf.jpg");
                g.drawImage(rys7, 109,158, this);
                Image rys8 = getImage(getDocumentBase(),"if.jpg");
                g.drawImage(rys8, 80,135, this);
            //  JPanel pusty = new JPanel();
                add(suw);
                g.setColor(Color.RED);
                if(fps>0)
                {

           for(int j=0; j<=fps;j++)
                g.drawPolyline(diod_x1, diod_y1, j);
                }                                 

            }
            else if (typFunkcji == "Mostek"){

                    //osie cha-yka wejsciowa
                g.setColor(Color.BLACK);
                g.drawLine(0, 100, 200, 100);
                g.drawLine(21, 40, 21, 150);
                g.drawLine(21,40,18,45);
                g.drawLine(21,40,24,45);
                g.drawLine(200,100,195,103);
                g.drawLine(200,100,195,97);

                    //osie cha-yka wyjsciowa

                g.drawLine(0, 210, 200, 210);
                g.drawLine(21, 155, 21, 220);
                g.drawLine(21,155,18,160);
                g.drawLine(21,155,24,160);
                g.drawLine(200,210,195,213);
                g.drawLine(200,210,195,207);
                Image rys5 = getImage(getDocumentBase(),"ug.jpg");
                g.drawImage(rys5, 29,33, this);
                Image rys6 = getImage(getDocumentBase(),"ul.jpg");
                g.drawImage(rys6, 29,148, this);
                g.setColor(Color.GREEN);
              for (double x = 0; x < 189; x += 0.1) {                
                y = (Math.sin(x * fps3/20) * fps2*5 + 100);
               g.drawLine((int) x, (int) y, (int) x, (int) y);

                 }
                 g.setColor(Color.RED);
                  for (double a = 0; a < 189; a += 0.1) {

                    b = (Math.sin(a * fps3/20) * fps2*5 +210);           

               if(b>=210)
                {   b = 210+ (210-(Math.sin(a * fps3/20) * fps2*5 +210));
                g.drawLine((int) a, (int) b, (int) a, (int) b);}
                else {b = (Math.sin(a * fps3/20) * fps2*5 +210);
                g.drawLine((int) a, (int) b, (int) a, (int) b);}

                  }
                  Image rys4 = getImage(getDocumentBase(),"mostek.jpg");
                g.drawImage(rys4, 20,230, null);

            }

            else if (typFunkcji == "tranzystor") {

            //osie
                //cha-yka1
                g.setColor(Color.BLACK);
                g.drawLine(30, 20, 30, 170);
                g.drawLine(10, 160, 150, 160);
                g.drawLine(30,20,27,25);
                g.drawLine(30,20,33,25);
                g.drawLine(150,160,145,163);
                g.drawLine(150,160,145,157);

                    //cha-yka2

                g.drawLine(30, 180, 30, 330);
                g.drawLine(10, 310, 150, 310);
                g.drawLine(30,180,27,185);
                g.drawLine(30,180,33,185);
                g.drawLine(150,310,145,313);
                g.drawLine(150,310,145,307);

                    //cha-yka3

                g.drawLine(390, 20, 390, 170);
                g.drawLine(370, 160, 540, 160);
                g.drawLine(390,20,387,25);
                g.drawLine(390,20,393,25);
                g.drawLine(540,160,535,163);
                g.drawLine(540,160,535,157);

                //char-yka 4

                g.drawLine(390, 180, 390, 330);
                g.drawLine(370, 310, 540, 310);
                g.drawLine(390,180,387,185);
                g.drawLine(390,180,393,185);
                g.drawLine(540,310,535,313);
                g.drawLine(540,310,535,307);

                g.setColor(Color.RED);
                //char1
             if(fps4>0)
                {

           for(int q=0; q<=fps4;q++)
                g.drawPolyline(tran_x1, tran_y1, q);
                }

             //char 2
             if(fps5>0)
                {
                    //640mV
                if(fps6==1){
                   for(int q2=0; q2<=fps5;q2++)
                g.drawPolyline(tran_x2, tran_y2, q2);
                }
                //660mV
                else if(fps6==2){
                        for(int q2=0; q2<=fps5;q2++)
                g.drawPolyline(tran_x3, tran_y3, q2);
                }
                //680mV
                 else if(fps6==3){
                        for(int q2=0; q2<=fps5;q2++)
                g.drawPolyline(tran_x4, tran_y4, q2);
                }
                //700mV
                else if(fps6==4){
                        for(int q2=0; q2<=fps5;q2++)
                g.drawPolyline(tran_x5, tran_y5, q2);
                }

                }
                 //char 3
             if(fps7>0)
                {

           for(int w=0; w<=fps7;w++)
                g.drawPolyline(tran_x6, tran_y6, w);
                }

                 //char 4
             if(fps8>0)
                {

           for(int r=0; r<=fps8;r++)
                g.drawPolyline(tran_x7, tran_y7, r);

                }

             }

              else if (typFunkcji == "wzmacniacz")
                {//g.drawPolyline(tran_x1, tran_y1, q);
                }

    }

}

}

0

juz wiem sam sobie rozwiazalem problem wystarczy dac repaint w kazdym changelistenerze gdy zmienia sie wartosc suwaka to repaint();

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0