diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TestNetSwing.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/TestNetSwing.java b/tests/TestNetSwing.java index ea93395..08c9db5 100644 --- a/tests/TestNetSwing.java +++ b/tests/TestNetSwing.java @@ -19,9 +19,14 @@ class TestNetSwing implements Runnable { private JComboBox domainBox; private int alpha=0; private Color color; - private static Color DEFAULT_COLOR = new Color(10,10,10,255); private static int FADINGSTEP = 20; - private static int FADINGSLEEP = 400; + private static int FADINGSLEEP = 100; + private static int DEFAULT_RED=200; + private static int DEFAULT_GREEN=10; + private static int DEFAULT_BLUE=10; + private static int DEFAULT_ALPHA=255; + private static Color DEFAULT_COLOR = + new Color(DEFAULT_RED,DEFAULT_GREEN,DEFAULT_BLUE,DEFAULT_ALPHA); private static String[] domainList = { "127.255.255.255:2010", @@ -112,7 +117,7 @@ class TestNetSwing implements Runnable { int i = text.indexOf(10); if (i>0) { receive.setText(text.substring(0,i)); } else { receive.setText(text); } - alpha=255; + alpha=DEFAULT_ALPHA; color=DEFAULT_COLOR; receive.setForeground(color); } @@ -211,7 +216,7 @@ class TestNetSwing implements Runnable { receive.setText(null); s=null; } - if (s!=null) { receive.setForeground(new Color(10,10,10,alpha)); } + if (s!=null) { receive.setForeground(new Color(DEFAULT_RED,DEFAULT_GREEN,DEFAULT_BLUE,alpha)); } } } public void stop(){ encore=false; } @@ -220,6 +225,7 @@ class TestNetSwing implements Runnable { private class ComboCB implements ActionListener { public void actionPerformed(ActionEvent e) { String newDomain=(String)domainBox.getSelectedItem(); + System.out.println("coucou "+ domainBox.getEditor().getItem()); // if it's the same domain, don't do anything if (newDomain == domain) { return; } domain=newDomain; |