Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * x2a1
- *
- * COMP 1020 SECTION Atrue2
- * INSTRUCTOR Pourang Polad Irani
- * ASSIGNMENT Assignment 2, question x1
- * Nathan Loewen, 7688029
- */
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.FileReader;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.util.ArrayList;
- import java.util.Timer;
- import java.util.TimerTask;
- public class x3q1 {
- /**
- * @brief Starts a Game of Life.
- *
- * @param args
- */
- public static void main(String[] args) {
- new x3q1();
- }
- /**
- * @brief Constructor for Game of Life.
- */
- public x3q1() {
- /* Create a new window */
- new Menu();
- }
- }
- /**
- * @brief The game menu. Shows previews of saved games and allows them to be selected.
- */
- class Menu extends JFrame implements MouseListener, MouseMotionListener {
- private static final long serialVersionUID = -8135714158736019980L;
- private JPanel_ pane = new JPanel_(); /** < Panel to draw to */
- private Graphics buffer; /** < Graphics buffer */
- private Image bufferImage; /** < Image to draw to in the buffer */
- private static ArrayList<boolean[][]> maps = new ArrayList<boolean[][]>(); /** < Stores the cell data. */
- private static int open; /**< The open map. */
- private final int WINDOWWIDTH = 800;
- private final int WINDOWHEIGHT = 800;
- private final int CELLWIDTH = 10;
- private final int CELLHEIGHT = 10;
- private int mouse_x = -1;
- private int mouse_y = -1;
- private Game game;
- private Menu menu = this;
- private static Object lock = new Object();
- public Menu() {
- /* Set window title */
- super("X3Q1 (Conway's Game of Life)");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- /* Inherit main frame */
- Container con = getContentPane();
- /* Add the panel */
- con.add(pane);
- pane.setLayout(null);
- setVisible(true);
- this.setBounds(0, 0, WINDOWWIDTH + getInsets().left
- + getInsets().right, WINDOWHEIGHT + getInsets().top
- + getInsets().bottom);
- this.setLocationRelativeTo(null);
- /* Set up graphics buffer */
- bufferImage = createImage(WINDOWWIDTH, WINDOWHEIGHT);
- buffer = bufferImage.getGraphics();
- pane.addMouseMotionListener(this);
- pane.addMouseListener(this);
- load();
- updatePreviews();
- }
- private void updatePreviews() {
- int x = 0;
- int y = 0;
- int X = 0;
- int Y = 0;
- int i,j,k;
- int width,height;
- double scale;
- boolean[][] map;
- Graphics drawTemp; /** < Graphics buffer */
- Image drawTempImage; /** < Image to draw to in the buffer */
- buffer.setColor(Color.LIGHT_GRAY);
- buffer.fillRect(0, 0, bufferImage.getWidth(this), bufferImage.getHeight(this));
- /* For each map */
- for (i=0; i<maps.size(); i++) {
- map = maps.get(i);
- drawTempImage = createImage(map[0].length * CELLWIDTH, map.length * CELLHEIGHT);
- drawTemp = drawTempImage.getGraphics();
- /* Calculate Sizing for map */
- width = drawTempImage.getWidth(this);
- height = drawTempImage.getHeight(this);
- scale = 400./Math.max(width,height);
- /* For each cell */
- for (j = 0; j < map.length; j++) {
- for (k = 0; k < map[0].length; k++) {
- /* Set drawing color */
- if (map[j][k])
- drawTemp.setColor(Color.black);
- else
- drawTemp.setColor(Color.white);
- /* Draw the cell */
- drawTemp.fillRect(x, y, CELLWIDTH, CELLHEIGHT);
- /* Draw the cell border */
- if (scale >= 1) {
- drawTemp.setColor(Color.LIGHT_GRAY);
- drawTemp.drawRect(x, y, CELLWIDTH, CELLWIDTH);
- }
- x += CELLWIDTH;
- }
- y += CELLHEIGHT;
- x = 0;
- }
- y = 0;
- /* Shade if mouse is not over it */
- if (i != (mouse_y+1)*(mouse_x+mouse_y+1)/2 || mouse_x == -1 || mouse_y == -1) {
- drawTemp.setXORMode(Color.white);
- drawTemp.setColor(Color.lightGray);
- drawTemp.fillRect(0, 0, drawTempImage.getWidth(this), drawTempImage.getHeight(this));
- }
- /* Draw to buffer */
- buffer.drawImage(drawTempImage,
- X+(int)((400-(width * scale))/2), Y+(int)((400-(height * scale))/2),
- (int)(width * scale) + X + (int)((400-(width * scale))/2),
- (int)(height * scale) + Y + (int)((400-(height * scale))/2),
- 0, 0, width,height,
- null);
- /* Draw boarder */
- buffer.setColor(Color.black);
- buffer.drawRect(X+(int)((400-(width * scale))/2), Y+(int)((400-(height * scale))/2),
- (int)(width * scale), (int)(height * scale));
- /* Update drawing position on bufferImage */
- X += 400;
- if (X>400) {
- X = 0;
- Y += 400;
- }
- }
- //if (mouse_x != -1 || mouse_y != -1) {
- // buffer.setColor(Color.blue);
- // buffer.drawRect(mouse_x * WINDOWWIDTH/2, mouse_y * WINDOWHEIGHT/2, WINDOWWIDTH/2, WINDOWHEIGHT/2);
- //}
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Loads save game from file.
- */
- private static void load() {
- BufferedReader fileIn; /** < File reader */
- char[] buf; /** < Buffer for characters in a line */
- String sizeBuf = ""; /** < Buffer for size of map */
- String lineBuf; /** < Buffer for line read from file */
- int i = 0;
- int x, y;
- int numMaps = 0;
- y = 0;
- try {
- /* Create file reader */
- fileIn = new BufferedReader(new FileReader("Life.txp"));
- /* Read and process each line */
- while ((lineBuf = fileIn.readLine()) != null) {
- buf = lineBuf.toCharArray();
- if (buf.length == 0) {
- continue;
- }
- /* If this line specifies dimensions */
- if (Character.isDigit(buf[0])) {
- /* Get X dimension */
- while (i < buf.length && Character.isDigit(buf[i])) {
- sizeBuf += buf[i];
- i++;
- }
- x = Integer.parseInt(sizeBuf);
- sizeBuf = "";
- i++;
- /* Get Y dimension */
- while (i < buf.length && Character.isDigit(buf[i])) {
- sizeBuf += buf[i];
- i++;
- }
- y = Integer.parseInt(sizeBuf);
- /* Add a new map */
- numMaps++;
- maps.ensureCapacity(numMaps);
- maps.add(new boolean[y][x]);
- /* Reset variables */
- sizeBuf = "";
- i = 0;
- y = 0;
- x = 0;
- /* Line specifies cell states */
- } else {
- if ( y < maps.get(numMaps-1).length) {
- for (x = 0; x < maps.get(numMaps-1)[0].length; x++) {
- /* Cell is live */
- if (Character.compare(buf[x], 'X') == 0)
- maps.get(numMaps-1)[y][x] = true;
- /* Cell is dead */
- else
- maps.get(numMaps-1)[y][x] = false;
- }
- }
- y++;
- }
- }
- fileIn.close();
- }
- /* catch IO errors */
- catch (IOException e) {
- System.out.println("IO Error!");
- e.printStackTrace();
- }
- }
- /**
- * @brief Saves the game state
- */
- public static void save(boolean[][] saveMap) {
- int x,y;
- BufferedWriter fileOut; /** < The file writer */
- /* Update the map in memory */
- maps.set(open, saveMap);
- try {
- /* Create the file writer */
- fileOut = new BufferedWriter(new FileWriter("Life.txp"));
- for (boolean[][] map : maps) {
- /* Write map dimensions */
- fileOut.write("" + map[0].length + " " + map.length);
- fileOut.newLine();
- /* Write cell states */
- for (y = 0; y < map.length; y++) {
- for (x = 0; x < map[0].length; x++) {
- if (map[y][x])
- fileOut.write("X");
- else
- fileOut.write(" ");
- }
- fileOut.newLine();
- }
- }
- fileOut.close();
- }
- /* catch IO errors */
- catch (IOException e) {
- System.out.println("IO Error!");
- e.printStackTrace();
- }
- }
- /**
- * @brief JPanel component with paintComponent() override.
- */
- class JPanel_ extends JPanel {
- private static final long serialVersionUID = 5318671062431096334L;
- /**
- * @brief Draws the buffer to the panel.
- */
- public void paintComponent(Graphics g) {
- g.drawImage(bufferImage, getInsets().left, getInsets().top,
- this);
- }
- }
- /**
- * @brief Called when the mouse moves over the pane.
- * updates the mouse position.
- */
- public void mouseMoved(MouseEvent event) {
- /* Get the cell that the mouse is over */
- int x = event.getX();
- int y = event.getY();
- x /= (WINDOWWIDTH/2);
- y /= (WINDOWHEIGHT/2);
- /* The mouse is over the same cell. Don't do anything */
- if (mouse_x == x && mouse_y == y)
- return;
- /* update the mouse position */
- mouse_x = x;
- mouse_y = y;
- /* redraw */
- updatePreviews();
- }
- /**
- * @brief Called when the mouse exits the pane.
- * Invalidates the mouse position.
- */
- public void mouseExited(MouseEvent arg0) {
- /* invalidate the mouse position */
- mouse_x = -1;
- mouse_y = -1;
- /* redraw */
- updatePreviews();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Called when we receive a mouse click.
- */
- public void mouseClicked(MouseEvent event) {
- /* Get the cell that was clicked on */
- int x = event.getX();
- int y = event.getY();
- x /= (WINDOWWIDTH/2);
- y /= (WINDOWHEIGHT/2);
- /* Toggle the cell */
- open = (y+1)*(x+y+1)/2;
- this.setVisible(false);
- game = new Game(maps.get(open));
- final Thread t = new Thread() {
- public void run() {
- synchronized(lock) {
- while (game.isVisible())
- try {
- lock.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- game = null;
- menu.setVisible(true);
- updatePreviews();
- menu.requestFocus();
- menu.toFront();
- return;
- }
- }
- };
- t.start();
- game.addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent arg0) {
- synchronized (lock) {
- game.setVisible(false);
- save(game.map);
- lock.notify();
- }
- }
- });
- }
- public void mouseDragged(MouseEvent arg0) {}
- public void mouseEntered(MouseEvent arg0) {}
- public void mousePressed(MouseEvent arg0) {}
- public void mouseReleased(MouseEvent arg0) {}
- }
- /**
- * @brief Defines a window for Conway's Game of Life
- */
- class Game extends JFrame implements ActionListener, MouseListener,
- ComponentListener, MouseMotionListener, KeyListener {
- private static final long serialVersionUID = 4295288338564549551L;
- private JPanel_ pane = new JPanel_(); /** < Panel to draw to */
- private final int CELLWIDTH = 10; /** < Width of one cell */
- private final int CELLHEIGHT = 10; /** < Height of one cell */
- private final int CONTROLHEIGHT = 40; /** < Height of game controls */
- private Graphics buffer; /** < Graphics buffer */
- private Image bufferImage; /** < Image to draw to in the buffer */
- private JButton button_startStop = new JButton("Start"); /** < Start/Stop button */
- private JButton button_clear = new JButton("Clear"); /** < Button to clear all cells */
- private boolean sizeable = true; /** < Guards against resize loops. */
- private int mouse_x = -1; /** < X position of cell containing mouse. */
- private int mouse_y = -1; /** < Y position of cell containing mouse. */
- boolean[][] map; /** < A map of cell states */
- private Timer loop; /** < Timer for the game loop. */
- private boolean running; /** < Whether the game loop is running. */
- /**
- * @Brief Constructor for the game window.
- */
- public Game(boolean[][] startingMap) {
- /* Set window title */
- super("X3Q1 (Conway's Game of Life)");
- map = startingMap;
- /* Set close operation */
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- /* Inherit main frame */
- Container con = getContentPane();
- /* Add the panel */
- con.add(pane);
- pane.setLayout(null);
- /* Set the window to be visible.
- * This is required for proper window sizing. */
- setVisible(true);
- /* Update the window size */
- if (sizeable) {
- sizeable = false;
- updateWindowSize();
- sizeable = true;
- }
- /* Set up Start/Stop button */
- button_startStop.addActionListener(this);
- button_startStop.setFocusable(false);
- pane.add(button_startStop);
- /* Set up Clear button */
- button_clear.addActionListener(this);
- button_clear.setFocusable(false);
- pane.add(button_clear);
- /* Listen */
- pane.addMouseListener(this);
- pane.addComponentListener(this);
- pane.addMouseMotionListener(this);
- addKeyListener(this);
- setFocusable(true);
- }
- /**
- * @brief Updates the cells.
- */
- private void updateMap() {
- boolean[][] newMap = new boolean[map.length][map[0].length]; /** < The new cells */
- int i, j;
- /* For each cell */
- for (i = 0; i < map.length; i++) {
- for (j = 0; j < map[i].length; j++) {
- /* If the cell is alive and should die */
- if (map[i][j]
- && !(neighbors(i, j) == 2 || neighbors(i, j) == 3))
- newMap[i][j] = false;
- /* If the cell is dead and should live */
- else if (!map[i][j] && neighbors(i, j) == 3)
- newMap[i][j] = true;
- /* The cell does nothing */
- else
- newMap[i][j] = map[i][j];
- }
- }
- /* Use the new map */
- map = newMap;
- }
- /**
- * @brief Finds the number of live neighbors a cell has.
- *
- * @param y
- * Vertical coordinate of cell.
- * @param x
- * Horizontal coordinate of cell.
- * @return The number of neighbors.
- */
- private int neighbors(int y, int x) {
- int neighbors = 0;
- /* Check the cells above. */
- if (y == 0) { /* Check for top edge */
- /* Top left */
- if (x == 0) { /* Check for left edge */
- if (map[map.length - 1][map[0].length - 1])
- neighbors++;
- } else if (map[map.length - 1][x - 1])
- neighbors++;
- /* Top center */
- if (map[map.length - 1][x])
- neighbors++;
- /* Top right */
- if (x == map[0].length - 1) { /* Check for right edge */
- if (map[map.length - 1][0])
- neighbors++;
- } else if (map[map.length - 1][x + 1])
- neighbors++;
- } else {
- /* Top left */
- if (x == 0) { /* Check for left edge */
- if (map[y - 1][map[0].length - 1])
- neighbors++;
- } else if (map[y - 1][x - 1])
- neighbors++;
- /* Top center */
- if (map[y - 1][x])
- neighbors++;
- /* Top right */
- if (x == map[0].length - 1) { /* Check for right edge */
- if (map[y - 1][0])
- neighbors++;
- } else if (map[y - 1][x + 1])
- neighbors++;
- }
- /* Check Left */
- if (x == 0) { /* Check for left edge */
- if (map[y][map[0].length - 1])
- neighbors++;
- } else if (map[y][x - 1])
- neighbors++;
- /* Check right */
- if (x == map[0].length - 1) { /* Check for right edge */
- if (map[y][0])
- neighbors++;
- } else if (map[y][x + 1])
- neighbors++;
- /* Check cells below */
- if (y == map.length - 1) { /* Check for bottom edge */
- /* bottom left */
- if (x == 0) { /* Check for left edge */
- if (map[0][map[0].length - 1])
- neighbors++;
- } else if (map[0][x - 1])
- neighbors++;
- /* bottom center */
- if (map[0][x])
- neighbors++;
- /* bottom right */
- if (x == map[0].length - 1) { /* Check for right edge */
- if (map[0][0])
- neighbors++;
- } else if (map[0][x + 1])
- neighbors++;
- } else {
- /* Bottom left */
- if (x == 0) { /* Check for left edge */
- if (map[y + 1][map[0].length - 1])
- neighbors++;
- } else if (map[y + 1][x - 1])
- neighbors++;
- /* Bottom center */
- if (map[y + 1][x])
- neighbors++;
- /* Bottom right */
- if (x == map[0].length - 1) { /* Check for right edge */
- if (map[y + 1][0])
- neighbors++;
- } else if (map[y + 1][x + 1])
- neighbors++;
- }
- return neighbors;
- }
- /**
- * @brief Resizes the game window to fit the map.
- */
- private void updateWindowSize() {
- /* Size window */
- this.setBounds(this.getWidth(), this.getHeight(), (map[0].length * CELLWIDTH
- + getInsets().left + getInsets().right),
- (map.length * CELLHEIGHT + getInsets().top
- + getInsets().bottom + CONTROLHEIGHT));
- this.setLocationRelativeTo(null);
- /* Set up graphics buffer */
- bufferImage = createImage(map[0].length * CELLWIDTH, map.length
- * CELLHEIGHT);
- buffer = bufferImage.getGraphics();
- /* Size buttons */
- updateControlSize();
- /* Redraw for new size */
- cellsUpdate();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Updates button states and sizes.
- */
- private void updateControlSize() {
- if (running) {
- /* Start/Stop button gets all the space */
- button_startStop.setBounds(0, map.length * CELLHEIGHT,
- map[0].length * CELLWIDTH, CONTROLHEIGHT);
- /* Disable the clear button */
- button_clear.setEnabled(false);
- }
- else {
- /* Enable the clear button */
- button_clear.setEnabled(true);
- /* The Start/Stop and clear buttons get spaced evenly */
- button_startStop.setBounds(0, map.length * CELLHEIGHT,
- map[0].length * CELLWIDTH / 2, CONTROLHEIGHT);
- button_clear.setBounds(map[0].length * CELLWIDTH / 2,
- map.length * CELLHEIGHT, map[0].length * CELLWIDTH / 2,
- CONTROLHEIGHT);
- }
- }
- /**
- * @brief The main logic for Conway's Game of Life. Is called by a Timer.
- */
- class gameLoop extends TimerTask {
- public void run() {
- /* Update the cell data */
- updateMap();
- /* Draw the cells to the buffer */
- cellsUpdate();
- /* Repaint the game window */
- invalidate();
- repaint();
- }
- }
- /**
- * @brief Updates the cells in the graphics buffer.
- */
- public void cellsUpdate() {
- int x = 0;
- int y = 0;
- /* For each cell */
- for (int i = 0; i < map.length; i++) {
- for (int j = 0; j < map[0].length; j++) {
- /* Set drawing color */
- if (map[i][j])
- buffer.setColor(Color.black);
- else
- buffer.setColor(Color.white);
- /* Draw the cell */
- buffer.fillRect(x, y, CELLWIDTH, CELLHEIGHT);
- /* Draw the cell border */
- buffer.setColor(Color.LIGHT_GRAY);
- buffer.drawRect(x, y, CELLWIDTH, CELLWIDTH);
- x += CELLWIDTH;
- }
- y += CELLHEIGHT;
- x = 0;
- }
- /* Highlight the cell that has the mouse */
- if (mouse_x >= 0 && mouse_y >= 0) {
- buffer.setColor(Color.blue);
- buffer.drawRect(mouse_x * CELLWIDTH, mouse_y * CELLWIDTH, CELLWIDTH, CELLHEIGHT);
- }
- }
- /**
- * @brief Toggles the games running state.
- */
- public void startStop() {
- if (running) {
- /* Change button text */
- button_startStop.setText("Start");
- /* Stop the game loop */
- loop.cancel();
- /* The window can now be resized */
- this.setResizable(true);
- /* We are no longer running */
- running = false;
- } else {
- /* Change button text */
- button_startStop.setText("Stop");
- /* Start the game loop */
- loop = new Timer();
- loop.scheduleAtFixedRate(new gameLoop(), 0, 150);
- /* Invalidate the mouse position */
- mouse_x = -1;
- mouse_y = -1;
- /* We are now running */
- running = true;
- }
- /* Update the buttons */
- updateControlSize();
- }
- /**
- * @brief Sets all cells to false
- */
- public void clear() {
- /* If the game is running, don't do anything */
- if (running)
- return;
- int i,j;
- /* Set each cell to false */
- for (i=0; i<map.length; i++)
- for (j=0; j<map[0].length; j++)
- map[i][j] = false;
- /* redraw */
- cellsUpdate();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief JPanel component with paintComponent() override.
- */
- class JPanel_ extends JPanel {
- private static final long serialVersionUID = 5318671062431096334L;
- /**
- * @brief Draws the buffer to the panel.
- */
- public void paintComponent(Graphics g) {
- g.drawImage(bufferImage, getInsets().left, getInsets().top,
- this);
- }
- }
- /**
- * @brief Called when a button is pushed.
- */
- public void actionPerformed(ActionEvent event) {
- Object source = event.getSource();
- /* If the Start/Stop button was pushed */
- if (source == button_startStop)
- startStop();
- /* If the clear button was pushed */
- else if (source == button_clear)
- clear();
- }
- /**
- * @brief Called when a keyboard button is pressed.
- */
- public void keyPressed(KeyEvent event) {
- int key = event.getKeyCode();
- if (key == KeyEvent.VK_SPACE)
- startStop();
- else if (key == KeyEvent.VK_ESCAPE)
- clear();
- }
- /**
- * @brief Called when we receive a mouse click.
- */
- public void mouseClicked(MouseEvent event) {
- /* If the game is running, don't do anything */
- if (running)
- return;
- /* Get the cell that was clicked on */
- int x = event.getX();
- int y = event.getY();
- x /= CELLWIDTH;
- y /= CELLHEIGHT;
- /* Not a valid cell, abort */
- if (x >= map[0].length || y >= map.length)
- return;
- /* Toggle the cell */
- map[y][x] = !map[y][x];
- cellsUpdate();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Called when the mouse moves over the pane.
- * updates the mouse position.
- */
- public void mouseMoved(MouseEvent event) {
- /* If the game is running, don't do anything */
- if (running)
- return;
- /* Get the cell that the mouse is over */
- int x = event.getX();
- int y = event.getY();
- x /= CELLWIDTH;
- y /= CELLHEIGHT;
- /* The mouse is over the same cell. Don't do anything */
- if (mouse_x == x && mouse_y == y)
- return;
- /* Not a valid cell */
- if (x >= map[0].length || y >= map.length) {
- x = -1;
- y = -1;
- }
- /* update the mouse position */
- mouse_x = x;
- mouse_y = y;
- /* redraw */
- cellsUpdate();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Called when the mouse exits the pane.
- * Invalidates the mouse position.
- */
- public void mouseExited(MouseEvent arg0) {
- /* If the game is running, don't do anything */
- if (running)
- return;
- /* invalidate the mouse position */
- mouse_x = -1;
- mouse_y = -1;
- /* redraw */
- cellsUpdate();
- this.invalidate();
- this.repaint();
- }
- /**
- * @brief Called when the window is resized
- */
- public void componentResized(ComponentEvent event) {
- /* Avoid infinite loops */
- if (!sizeable)
- return;
- /* Nobody is allowed to resize */
- sizeable = false;
- /* If we arn't running, it is ok to update the size */
- if (!running) {
- /* Calculate new array dimensions */
- int x = event.getComponent().getWidth() / CELLWIDTH;
- int y = (event.getComponent().getHeight() - CONTROLHEIGHT)
- / CELLHEIGHT;
- /* edge case where array dimensions are less than 0. */
- if (x<0 || y<0) {
- sizeable = true;
- return;
- }
- /* If we need to resize the array */
- if (y != map.length || x != map[0].length) {
- /* Create the new array */
- boolean[][] newMap = new boolean[y][x];
- for (int i = 0; i < Math.min(y, map.length); i++) {
- System.arraycopy(map[i], 0, newMap[i], 0,
- Math.min(x, map[0].length));
- }
- map = newMap;
- }
- }
- /* Update the window */
- updateWindowSize();
- this.invalidate();
- this.repaint();
- /* Resizing is now allowed */
- sizeable = true;
- }
- /* Unused required methods */
- public void mouseEntered(MouseEvent event) {}
- public void mousePressed(MouseEvent arg0) {}
- public void mouseReleased(MouseEvent arg0) {}
- public void componentHidden(ComponentEvent arg0) {}
- public void componentMoved(ComponentEvent arg0) {}
- public void componentShown(ComponentEvent arg0) {}
- public void mouseDragged(MouseEvent arg0) {}
- public void keyReleased(KeyEvent arg0) {}
- public void keyTyped(KeyEvent arg0) {}
- }
Add Comment
Please, Sign In to add comment