diff --git a/src/main/java/info/istlab/ServerTester/RemoteHostsWindow.java b/src/main/java/info/istlab/ServerTester/RemoteHostsWindow.java index beaf172..ddb11f3 100644 --- a/src/main/java/info/istlab/ServerTester/RemoteHostsWindow.java +++ b/src/main/java/info/istlab/ServerTester/RemoteHostsWindow.java @@ -80,6 +80,7 @@ class RemoteHostPanel extends JPanel { String hostip; + public static Color grayColor = new Color(0xaaeeee); public RemoteHostPanel(String _hostip, String value) { hostip = _hostip; @@ -109,13 +110,21 @@ addressLabel.setForeground(Color.red); } panel.add(addressLabel); - panel.add(new JLabel(info[3])); + JLabel statusLabel = new JLabel(" "+info[3]+" "); + statusLabel.setOpaque(true); + panel.add(statusLabel); JButton button = new JButton("Connect"); panel.add(button); if (info[3].equals("Running")) { button.setEnabled(true); + statusLabel.setForeground(Color.blue); + statusLabel.setBackground(grayColor); + statusLabel.repaint(); } else { button.setEnabled(false); + statusLabel.setForeground(Color.black); + statusLabel.setBackground(Color.yellow); + statusLabel.repaint(); } button.addActionListener(e -> { // もしbind addressが0.0.0.0だったら、hostipを使う