예제 #1
0
  private void setUpGui() {
    area = JokemonDriver.Area.Stringville;
    mouse = new Point();
    int thingInt = 0;
    this.setTitle("Town Map");
    this.setSize(195, 239);
    this.setResizable(false);
    this.setLayout(null);
    this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    this.setVisible(false);
    visible = false;
    this.setLocationRelativeTo(null);
    Container cp = this.getContentPane();

    JLabel map = new JLabel();
    map.setBounds(1, -5, 188, 176);
    map.setIcon(new ImageIcon(townMap.class.getResource("Logos/townmap.png")));

    closeWindow = new JButton();
    closeWindow.setText("Close Window");
    closeWindow.setBounds(0, 192, 188, 20);

    areaDisplay = new JLabel();
    areaDisplay.setText(area.toString().replace('_', ' '));
    areaDisplay.setHorizontalAlignment(JLabel.CENTER);
    areaDisplay.setBounds(0, 171, 188, 20);

    addMouseMotionListener(this);
    closeWindow.addActionListener(this);
    cp.add(map);
    cp.add(closeWindow);
    cp.add(areaDisplay);
  }
예제 #2
0
 private void changeDisplay() {
   areaDisplay.setText(area.toString().replace('_', ' '));
 }