Bläddra i källkod

Remove unnecessary menu

master
Ben Kurtovic 12 år sedan
förälder
incheckning
a23aee72f1
1 ändrade filer med 2 tillägg och 8 borttagningar
  1. +2
    -8
      src/Render.java

+ 2
- 8
src/Render.java Visa fil

@@ -17,23 +17,19 @@ public class Render extends Canvas implements Runnable, MouseListener,
public static int width;
public static int height;
public static int scale;
public int fps_now;
public int fps_now;
public boolean paused;
public String rule;
public boolean reset;
private Grid _grid;
private int[] _pixels;
private BufferedImage _image;
private long _lastTick;
private String[] _rules;
private JFrame _frame;
private JButton pauseButton;
private Random random = new Random();
public Render(int width, int height, Grid g, String[] rules) {
@@ -80,15 +76,13 @@ public class Render extends Canvas implements Runnable, MouseListener,
private void setFrame() {
JMenuBar menuBar = new JMenuBar();
JMenu menuMain = new JMenu("Menu");
JMenu menuAlgo = new JMenu("Algorithms");
for (String rule : _rules) {
JMenuItem menuAlgoItem = new JMenuItem(rule);
menuAlgo.add(menuAlgoItem);
menuAlgoItem.addActionListener(this);
}
menuMain.add(menuAlgo);
menuBar.add(menuMain);
menuBar.add(menuAlgo);
pauseButton = new JButton("Pause");
pauseButton.setActionCommand("pause");


Laddar…
Avbryt
Spara