mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-15 03:15:05 +01:00
Basic window; not much in it yet
This commit is contained in:
parent
2e70f2c801
commit
8bc119d715
@ -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();
|
||||
scanWrap.setLayout(new BoxLayout(scanWrap, BoxLayout.X_AXIS));
|
||||
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(scanButton);
|
||||
add(Box.createRigidArea(new Dimension(1, 4)));
|
||||
add(optionsButton);
|
||||
add(Box.createRigidArea(new Dimension(1, 4)));
|
||||
add(scanWrap);
|
||||
add(Box.createRigidArea(new Dimension(1, 4)));
|
||||
add(autoActivateWrap);
|
||||
|
54
src/net/ash/HIDToVPADNetworkClient/gui/GuiOptionsWindow.java
Normal file
54
src/net/ash/HIDToVPADNetworkClient/gui/GuiOptionsWindow.java
Normal 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));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user