Basic window; not much in it yet

This commit is contained in:
Ash 2017-04-10 19:04:06 +10:00
parent 2e70f2c801
commit 8bc119d715
2 changed files with 69 additions and 0 deletions

View File

@ -86,6 +86,19 @@ public final class GuiInputControls extends JPanel {
} }
}); });
final JButton optionsButton = new JButton("Options");
optionsButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
GuiOptionsWindow.showWindow();
}
});
}
});
JPanel scanWrap = new JPanel(); JPanel scanWrap = new JPanel();
scanWrap.setLayout(new BoxLayout(scanWrap, BoxLayout.X_AXIS)); scanWrap.setLayout(new BoxLayout(scanWrap, BoxLayout.X_AXIS));
JLabel label = new JLabel("Auto Scan for Controllers: "); JLabel label = new JLabel("Auto Scan for Controllers: ");
@ -126,6 +139,8 @@ public final class GuiInputControls extends JPanel {
add(Box.createRigidArea(new Dimension(1, 4))); add(Box.createRigidArea(new Dimension(1, 4)));
add(scanButton); add(scanButton);
add(Box.createRigidArea(new Dimension(1, 4))); add(Box.createRigidArea(new Dimension(1, 4)));
add(optionsButton);
add(Box.createRigidArea(new Dimension(1, 4)));
add(scanWrap); add(scanWrap);
add(Box.createRigidArea(new Dimension(1, 4))); add(Box.createRigidArea(new Dimension(1, 4)));
add(autoActivateWrap); add(autoActivateWrap);

View File

@ -0,0 +1,54 @@
/*******************************************************************************
* Copyright (c) 2017 Ash (QuarkTheAwesome) & Maschell
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/
package net.ash.HIDToVPADNetworkClient.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import lombok.extern.java.Log;
@Log
public class GuiOptionsWindow extends JPanel {
private static final long serialVersionUID = 1L;
private static GuiOptionsWindow instance = new GuiOptionsWindow();
public static void showWindow() {
JFrame window = new JFrame("Options");
//TODO: close behaviour
instance.setOpaque(true);
window.setContentPane(instance);
window.pack();
window.setVisible(true);
}
private GuiOptionsWindow() {
super(new BorderLayout());
log.info("Hello from the Options window!");
setPreferredSize(new Dimension(200, 100));
}
}