MadDriver's Armatar

MadDriver

  • Member since: 10/20/2012
  • SteamID: s
 
 

About

package funkcije; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; public class ProzorFunkcije extends Frame { Panel ploca; Button dugme; Funkcija funkcija; // ArrayList<Funkcija> Lista= new ArrayList(); Platno p; private class Platno extends Canvas { public void paint(Graphics g) { Rectangle dim = g.getClipBounds(); /* * int p1=(int)xmin; int q1=(int)funkcija.F(xmin); for(double * x=xmin; x<=xmax;x+=0.1){ double y=f.rezultat(x); int p2=(int) * (dim.getWidth()*((x-xmin)/(x-xmax))); int q2=(int) * (dim.getHeight()*((ymax-y)/(ymax-ymin))); g.drawLine(p1, q1, p2, * q2); p1=p2; q1=q2; * * * } */g.drawLine(0, 0, 300, 300); } } public ProzorFunkcije() { super("Funkcije"); setVisible(true); setBounds(200, 200, 800, 400); setResizable(false); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent d) { dispose(); } }); // -----WEST GridLayout g = new GridLayout(4, 1); ploca = new Panel(g); Panel z1 = new Panel(), z2 = new Panel(), z3 = new Panel(), z4 = new Panel(); Label l1 = new Label("xmin:"); z1.add(l1); TextField f1 = new TextField(); z1.add(f1); ploca.add(z1); Label l2 = new Label("xmax:"); z2.add(l2); TextField f2 = new TextField(); z2.add(f2); ploca.add(z2); Label l3 = new Label("ymin:"); z3.add(l3); TextField f3 = new TextField(); z3.add(f3); ploca.add(z3); Label l4 = new Label("ymax:"); z4.add(l4); TextField f4 = new TextField(); z4.add(f4); ploca.add(z4); add(ploca, "West"); // ------- // ----EAST g = new GridLayout(4, 1); ploca = new Panel(g); Panel z11 = new Panel(), z22 = new Panel(), z33 = new Panel(), z44 = new Panel(); Label l11 = new Label("a:"); z11.add(l11); TextField f11 = new TextField(); z11.add(f11); ploca.add(z11); Label l22 = new Label("b:"); z22.add(l22); TextField f22 = new TextField(); z22.add(f22); ploca.add(z22); Label l33 = new Label("c:"); z33.add(l33); TextField f33 = new TextField(); z33.add(f33); ploca.add(z33); Label l44 = new Label("d:"); z44.add(l44); TextField f44 = new TextField(); z44.add(f44); ploca.add(z44); add(ploca,"East"); // ----- // ---CENTER p = new Platno(); add(p, "Center"); // CheckboxGroup grupa1 = new CheckboxGroup(); // ---SOUTH ploca = new Panel(); Button dugme = new Button("Crtaj"); Crtaj c = new Crtaj(); dugme.addActionListener(c); ploca.add(dugme); add(ploca, "South"); } public class Crtaj implements ActionListener { public void actionPerformed(ActionEvent d) { p.repaint(); } } public static void main(String[] args) { new ProzorFunkcije(); } }

1Games Rated 2Comments 0Likes 0Forum Posts 0Games Submitted 0Merits

MadDriver's Quests (1)

Show All Quests

The Messenger

Rules and Guidelines

Favorite Games

No games faved yet!

Friends

All friends »