Commit 8add75eb authored by 9731301's avatar 9731301

add center features

parent ee6b767d
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="f2dd20fb-7e97-49ef-9dfe-5631626d7912" name="Default Changelist" comment="" /> <list default="true" id="f2dd20fb-7e97-49ef-9dfe-5631626d7912" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/InsomniaGUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/InsomniaGUI.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
...@@ -14,6 +18,9 @@ ...@@ -14,6 +18,9 @@
</list> </list>
</option> </option>
</component> </component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1bIsIYbvZExsc7FREkkeVEtlB9E" /> <component name="ProjectId" id="1bIsIYbvZExsc7FREkkeVEtlB9E" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
...@@ -22,6 +29,7 @@ ...@@ -22,6 +29,7 @@
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
</component> </component>
...@@ -50,6 +58,7 @@ ...@@ -50,6 +58,7 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1588330863345</updated> <updated>1588330863345</updated>
<workItem from="1588330867580" duration="8005000" /> <workItem from="1588330867580" duration="8005000" />
<workItem from="1588425228961" duration="7926000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -57,22 +66,22 @@ ...@@ -57,22 +66,22 @@
<option name="version" value="1" /> <option name="version" value="1" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state width="793" height="208" key="GridCell.Tab.0.bottom" timestamp="1588338981527"> <state width="781" height="81" key="GridCell.Tab.0.bottom" timestamp="1588433110531">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="793" height="208" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" /> <state width="781" height="81" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1588433110531" />
<state width="793" height="208" key="GridCell.Tab.0.center" timestamp="1588338981527"> <state width="781" height="81" key="GridCell.Tab.0.center" timestamp="1588433110531">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="793" height="208" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" /> <state width="781" height="81" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1588433110531" />
<state width="793" height="208" key="GridCell.Tab.0.left" timestamp="1588338981527"> <state width="781" height="81" key="GridCell.Tab.0.left" timestamp="1588433110531">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="793" height="208" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" /> <state width="781" height="81" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1588433110531" />
<state width="793" height="208" key="GridCell.Tab.0.right" timestamp="1588338981527"> <state width="781" height="81" key="GridCell.Tab.0.right" timestamp="1588433110531">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="793" height="208" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" /> <state width="781" height="81" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1588433110531" />
<state x="425" y="237" key="com.intellij.ide.util.TipDialog" timestamp="1588330868442"> <state x="425" y="237" key="com.intellij.ide.util.TipDialog" timestamp="1588330868442">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
......
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*; import java.awt.*;
public class InsomniaGUI { public class InsomniaGUI {
...@@ -11,7 +12,9 @@ public class InsomniaGUI { ...@@ -11,7 +12,9 @@ public class InsomniaGUI {
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true); frame.setVisible(true);
JMenuBar menuBar = new JMenuBar(); Border border = BorderFactory.createLineBorder(Color.BLACK,3);
JMenuBar upperMenuBar = new JMenuBar();
JMenu application = new JMenu("Application"); JMenu application = new JMenu("Application");
JMenu edit = new JMenu("Edit"); JMenu edit = new JMenu("Edit");
JMenu view = new JMenu("View"); JMenu view = new JMenu("View");
...@@ -19,25 +22,72 @@ public class InsomniaGUI { ...@@ -19,25 +22,72 @@ public class InsomniaGUI {
JMenuItem minimize = new JMenuItem("Minimize"); JMenuItem minimize = new JMenuItem("Minimize");
window.add(minimize); window.add(minimize);
JMenu help = new JMenu("Help"); JMenu help = new JMenu("Help");
upperMenuBar.add(application);
upperMenuBar.add(edit);
upperMenuBar.add(view);
upperMenuBar.add(window);
upperMenuBar.add(help);
JPanel body = new JPanel();
body.setBackground(Color.GRAY);
JPanel auth = new JPanel();
auth.setBackground(Color.GRAY);
JPanel query = new JPanel();
query.setBackground(Color.GRAY);
JPanel header = new JPanel();
header.setBackground(Color.GRAY);
JPanel docs = new JPanel();
docs.setBackground(Color.GRAY);
//center_center
JTabbedPane tabbedPaneCenter = new JTabbedPane();
tabbedPaneCenter.setBackground(Color.GRAY);
tabbedPaneCenter.add("Body" , body);
tabbedPaneCenter.add("Auth" , auth);
tabbedPaneCenter.add("Query" , query);
tabbedPaneCenter.add("Header" , header);
tabbedPaneCenter.add("Docs" , docs);
//center_up
JMenuItem patch = new JMenuItem();
JMenuItem put = new JMenuItem();
JMenuItem post = new JMenuItem();
JMenuItem delete = new JMenuItem();
JMenuItem get = new JMenuItem();
JMenu centerMenu = new JMenu("Menu");
centerMenu.add("Patch",patch);
centerMenu.add("Put",put);
centerMenu.add("Post",post);
centerMenu.add("Delete",delete);
centerMenu.add("Get",get);
centerMenu.setFont(new Font("Arial",20,15 ));
JTextField URLTextField = new JTextField("http://api.myproduct.com/v1/users");
menuBar.add(application); JButton sendButton = new JButton("send");
menuBar.add(edit);
menuBar.add(view);
menuBar.add(window);
menuBar.add(help);
JPanel centerUp = new JPanel(new BorderLayout());
centerUp.add(centerMenu , BorderLayout.WEST);
centerUp.add(URLTextField , BorderLayout.CENTER);
centerUp.add(sendButton , BorderLayout.EAST);
JPanel center = new JPanel(new BorderLayout());
center.add(centerUp,BorderLayout.NORTH);
center.add(tabbedPaneCenter , BorderLayout.CENTER);
JPanel panelRight = new JPanel(new GridLayout(1 ,2 )); JPanel panelRight = new JPanel(new GridLayout(1 ,2 ));
panelRight.add(center);
JMenu menu = new JMenu("Insomnia"); JMenu menu = new JMenu("Insomnia");
menu.setSize(100,60); menu.setFont(new Font("Arial",20,15 ));
// menu.setBorder(); menu.setBorder(border);
menu.setPreferredSize(new Dimension(200,60));
JPanel panelLeft = new JPanel(new BorderLayout()); JPanel panelLeft = new JPanel(new BorderLayout());
panelLeft.add(menu , BorderLayout.NORTH); panelLeft.add(menu , BorderLayout.NORTH);
panelLeft.setBackground(Color.LIGHT_GRAY);
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(menuBar , BorderLayout.NORTH); panel.add(upperMenuBar , BorderLayout.NORTH);
panel.add(panelLeft , BorderLayout.WEST); panel.add(panelLeft , BorderLayout.WEST);
panel.add(panelRight , BorderLayout.CENTER); panel.add(panelRight , BorderLayout.CENTER);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment