Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MetodyGeneryczne4;
- // Jedi2.java:
- import java.applet.Applet;
- import java.awt.*;
- public class Pair extends Applet {
- public void paint(Graphics g){
- Rysowanie p1 = new Rysowanie("Sith ma czerwony miecz", 20, 20);
- g.drawString(p1.getToBeDrawn(),p1.getXcoordinate(),p1.getYcoordinate());
- }
- }// koniec public class Jedi2.class extends Applet
- class Rysowanie {
- /*
- * str the string to be drawn.x the x coordinate.y the y coordinate.
- */
- private String toBeDrawn;
- private int xCoordinate;
- private int yCoordinate;
- public Rysowanie(String napis, int x, int y) {
- this.toBeDrawn = napis;
- this.xCoordinate = x;
- this.yCoordinate = y;
- }
- public String getToBeDrawn() {
- return toBeDrawn;
- }
- public void setToBeDrawn(String napis) {
- this.toBeDrawn = napis;
- }
- public int getXcoordinate() {
- return xCoordinate;
- }
- public int getYcoordinate() {
- return yCoordinate;
- }
- public void setXcoordinate(int x) {
- this.xCoordinate = x;
- }
- public void setYcoordinate(int y) {
- this.yCoordinate = y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement