VERİ YAPILARI import java.applet.Applet; import java.awt.*; public class MFrame extends Applet { private Frame f; private Font x; private String s; private Label l; private Button showFrame; public void init() { String s2 = " Yeni Frame a‡mak i‡in Buraya Bas•n•z!"; s = "FRAME"; x = new Font("Courier",Font.BOLD,36); showFrame = new Button(s2); add(showFrame); } public boolean action(Event e, Object o) { if(e.target==showFrame) { if(f!=null) { f.hide(); f.dispose(); }; f = new Frame("Bir Frame"); l=new Label(s); l.setFont(x); f.setLayout(new FlowLayout()); f.add(l); f.resize(300,100); f.show(); } return true; } } 1 VERİ YAPILARI import java.awt.*; import java.awt.event.*; import javax.swing.*; class MFrame2 extends JFrame { public MFrame2() { super("€oklu Frame Ornegi"); Container c = getContentPane(); c.setLayout(new FlowLayout()); final JButton yeniFrm = new JButton("yeniFrm"); yeniFrm.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { } } ); c.add(yeniFrm); setSize(200,150); show(); } public static void main ( String args[] ) { MFrame2 app = new MFrame2(); app.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); } } 2 VERİ YAPILARI public class MFrame extends JFrame { public MFrame() { super("€oklu Frame Ornegi"); Container c = getContentPane(); c.setLayout(new FlowLayout()); final JButton yeniFrm = new JButton("yeniFrm"); yeniFrm.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { MFrame2 ap2 = new MFrame2(); } } ); c.add(yeniFrm); setSize(200,150); show(); } public static void main ( String args[] ) { MFrame app = new MFrame(); app.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); } } 3 VERİ YAPILARI // GUI (Graphical User Interface) içeren grafik // örneği import java.applet.*; import java.awt.*; public class Grafik extends Applet { int a[] = { 100, 75, 50, 65 }; Button b1; public void init() { b1 = new Button("Dugme"); add(b1); } public void paint(Graphics g) { for(int i=0; i<a.length; ++i) { g.drawRect(i*10,25,10,a[i]); } } } 4