提交 d8f8c54a authored 作者: Thomas Mueller's avatar Thomas Mueller

The H2 Console "Start Browser" button now works even when the IP address changes…

The H2 Console "Start Browser" button now works even when the IP address changes while the tool runs
上级 f6eb2bf3
...@@ -259,6 +259,7 @@ public class WebServer implements Service { ...@@ -259,6 +259,7 @@ public class WebServer implements Service {
} }
public String getURL() { public String getURL() {
updateURL();
return url; return url;
} }
......
...@@ -53,6 +53,7 @@ ShutdownHandler { ...@@ -53,6 +53,7 @@ ShutdownHandler {
private boolean trayIcon; private boolean trayIcon;
private Font font; private Font font;
private Button startBrowser; private Button startBrowser;
private TextField urlText;
//## AWT end ## //## AWT end ##
private Server web, tcp, pg; private Server web, tcp, pg;
private boolean isWindows; private boolean isWindows;
...@@ -373,14 +374,14 @@ ShutdownHandler { ...@@ -373,14 +374,14 @@ ShutdownHandler {
label.setFont(font); label.setFont(font);
mainPanel.add(label, constraintsLabel); mainPanel.add(label, constraintsLabel);
TextField text = new TextField(); urlText = new TextField();
text.setEditable(false); urlText.setEditable(false);
text.setFont(font); urlText.setFont(font);
text.setText(web.getURL()); urlText.setText(web.getURL());
if (isWindows) { if (isWindows) {
text.setFocusable(false); urlText.setFocusable(false);
} }
mainPanel.add(text, constraintsTextField); mainPanel.add(urlText, constraintsTextField);
startBrowser = new Button("Start Browser"); startBrowser = new Button("Start Browser");
startBrowser.setFocusable(false); startBrowser.setFocusable(false);
...@@ -405,7 +406,9 @@ ShutdownHandler { ...@@ -405,7 +406,9 @@ ShutdownHandler {
private void startBrowser() { private void startBrowser() {
if (web != null) { if (web != null) {
Server.openBrowser(web.getURL()); String url = web.getURL();
urlText.setText(url);
Server.openBrowser(url);
} }
} }
//## AWT end ## //## AWT end ##
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论