Browse Source

added missing getPreferredSize and getMinimumSize

master
Hannes Dürr 3 years ago
parent
commit
3fb9cef440
2 changed files with 20 additions and 1 deletions
  1. 19
    0
      src/EierUhrKomponente/EierUhr.java
  2. 1
    1
      src/test/Start.java

+ 19
- 0
src/EierUhrKomponente/EierUhr.java View File



package EierUhrKomponente; package EierUhrKomponente;


import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.net.Socket; import java.net.Socket;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;


} }
@Override
public void paintComponent(Graphics g) public void paintComponent(Graphics g)
{ {
view.paintComponent(g); view.paintComponent(g);
} }
public void Start(int zahl) public void Start(int zahl)
{ {
ctrl.start(zahl); ctrl.start(zahl);
} }
public int getZahl() public int getZahl()
{ {
return ctrl.getZahl(); return ctrl.getZahl();
{ {
listenerListe.forEach(listener -> listener.timeIsOver(evt)); listenerListe.forEach(listener -> listener.timeIsOver(evt));
} }
public synchronized void addEierUhrListener(EierUhrListener listener) public synchronized void addEierUhrListener(EierUhrListener listener)
{ {
listenerListe.add(listener); listenerListe.add(listener);
} }
public synchronized void removeEierUhrListener(EierUhrListener listener) public synchronized void removeEierUhrListener(EierUhrListener listener)
{ {
listenerListe.remove(listener); listenerListe.remove(listener);
} }
@Override
public Dimension getMinimumSize()
{
return new Dimension(200, 150);
}
@Override
public Dimension getPreferredSize()
{
return new Dimension(200, 150);
}
} }

+ 1
- 1
src/test/Start.java View File

// Controller ctrl = new Controller(view, model); // Controller ctrl = new Controller(view, model);


view.setTitle("Test"); view.setTitle("Test");
view.setSize(800, 600);
view.pack();
view.setVisible(true); view.setVisible(true);


} }

Loading…
Cancel
Save