Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication6;
- import java.awt.*;
- /**
- *
- * @author xrener
- */
- public class JavaApplication6 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Frame frame = new Frame();
- frame.setSize(300, 300);
- Panel panel1 = new Panel(); // vytvaranie objektu
- Panel panel2 = new Panel();
- Panel panel3 = new Panel();
- Button tla1 = new Button("Tlacidlo 1");
- Button tla2 = new Button("Tlacidlo 2");
- Button tla3 = new Button("Tlacidlo 3");
- Button tla4 = new Button("Tlacidlo 4");
- panel1.add(tla1);
- panel1.add(tla2);
- panel1.add(tla3);
- panel1.add(tla4);
- Label label = new Label("Ahoj ako sa mas");
- Canvas platno = new Canvas();
- platno.setSize(200, 200);
- panel2.add(platno, BorderLayout.NORTH);
- panel2.add(label, BorderLayout.SOUTH);
- Button tla5 = new Button("OK");
- Button tla6 = new Button("CANCEL");
- panel3.setLayout(new GridLayout(1, 2));
- panel3.add(tla5); //1. riadok 1.stlpca
- panel3.add(tla6); //1. riadok, 2.stlpca
- frame.add(panel1, BorderLayout.NORTH);
- frame.add(panel2, BorderLayout.CENTER);
- frame.add(panel3, BorderLayout.SOUTH);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment