X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fgui%2FNodeManagerPage.java;h=8efc2ed504ab0851ad096d64192049158a84848d;hb=8db42d2121e8ee465ab8380a66febde1949a0106;hp=49c25bc21fbd803d8950217a3fbd5c9c55c41528;hpb=9e6e70c28963fde2a6c8b120974f8a70d4da25bc;p=jSite.git diff --git a/src/main/java/de/todesbaum/jsite/gui/NodeManagerPage.java b/src/main/java/de/todesbaum/jsite/gui/NodeManagerPage.java index 49c25bc..8efc2ed 100644 --- a/src/main/java/de/todesbaum/jsite/gui/NodeManagerPage.java +++ b/src/main/java/de/todesbaum/jsite/gui/NodeManagerPage.java @@ -1,5 +1,5 @@ /* - * jSite - NodeManagerPage.java - Copyright © 2006–2012 David Roden + * jSite - NodeManagerPage.java - Copyright © 2006–2019 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -198,7 +198,6 @@ public class NodeManagerPage extends TWizardPage implements ListSelectionListene nodeList.setName("node-list"); nodeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); nodeList.addListSelectionListener(this); - nodeList.setPreferredSize(new Dimension(250, -1)); nodeNameTextField = new JTextField(""); nodeNameTextField.getDocument().putProperty("Name", "node-name"); @@ -237,7 +236,9 @@ public class NodeManagerPage extends TWizardPage implements ListSelectionListene nodeInformationPanel.add(nodePortSpinner, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0)); setLayout(new BorderLayout(12, 12)); - add(new JScrollPane(nodeList), BorderLayout.LINE_START); + final JScrollPane nodeListScrollPane = new JScrollPane(nodeList); + nodeListScrollPane.setPreferredSize(new Dimension(250, -1)); + add(nodeListScrollPane, BorderLayout.LINE_START); add(centerPanel, BorderLayout.CENTER); I18nContainer.getInstance().registerRunnable(new Runnable() { @@ -347,6 +348,7 @@ public class NodeManagerPage extends TWizardPage implements ListSelectionListene private void addNode() { Node node = new Node("localhost", 9481, I18n.getMessage("jsite.node-manager.new-node")); nodeListModel.addElement(node); + nodeList.setSelectedIndex(nodeListModel.size() - 1); deleteNodeAction.setEnabled(nodeListModel.size() > 1); wizard.setNextEnabled(true); fireNodesUpdated(getNodes());