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

@@ -6,6 +6,7 @@

package EierUhrKomponente;

import java.awt.Dimension;
import java.awt.Graphics;
import java.net.Socket;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -41,14 +42,18 @@ public class EierUhr extends JComponent

}
@Override
public void paintComponent(Graphics g)
{
view.paintComponent(g);
}
public void Start(int zahl)
{
ctrl.start(zahl);
}
public int getZahl()
{
return ctrl.getZahl();
@@ -58,12 +63,26 @@ public class EierUhr extends JComponent
{
listenerListe.forEach(listener -> listener.timeIsOver(evt));
}
public synchronized void addEierUhrListener(EierUhrListener listener)
{
listenerListe.add(listener);
}
public synchronized void removeEierUhrListener(EierUhrListener 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

@@ -28,7 +28,7 @@ public class Start
// Controller ctrl = new Controller(view, model);

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

}

Loading…
Cancel
Save