Commit ee6b767d authored by 9731301's avatar 9731301

add frame and menu bar and some panels

parents
Pipeline #4437 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="true" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Insomnia.iml" filepath="$PROJECT_DIR$/Insomnia.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f2dd20fb-7e97-49ef-9dfe-5631626d7912" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="ProjectId" id="1bIsIYbvZExsc7FREkkeVEtlB9E" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
</component>
<component name="RunManager">
<configuration name="Insomnia" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Insomnia" />
<module name="Insomnia" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Insomnia" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="f2dd20fb-7e97-49ef-9dfe-5631626d7912" name="Default Changelist" comment="" />
<created>1588330863345</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1588330863345</updated>
<workItem from="1588330867580" duration="8005000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state width="793" height="208" key="GridCell.Tab.0.bottom" timestamp="1588338981527">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="793" height="208" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" />
<state width="793" height="208" key="GridCell.Tab.0.center" timestamp="1588338981527">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="793" height="208" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" />
<state width="793" height="208" key="GridCell.Tab.0.left" timestamp="1588338981527">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="793" height="208" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" />
<state width="793" height="208" key="GridCell.Tab.0.right" timestamp="1588338981527">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="793" height="208" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1588338981527" />
<state x="425" y="237" key="com.intellij.ide.util.TipDialog" timestamp="1588330868442">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="425" y="237" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1588330868442" />
<state x="46" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1588333540387">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="46" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1588333540387" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
public class Insomnia {
public static void main(String [] args){
InsomniaGUI insomniaGUI = new InsomniaGUI();
}
}
import javax.swing.*;
import java.awt.*;
public class InsomniaGUI {
JFrame frame ;
public InsomniaGUI(){
frame = new JFrame();
frame.setTitle("Insomnia");
frame.setSize(900,600);
frame.setLocation(200,100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
JMenuBar menuBar = new JMenuBar();
JMenu application = new JMenu("Application");
JMenu edit = new JMenu("Edit");
JMenu view = new JMenu("View");
JMenu window = new JMenu("Tools");
JMenuItem minimize = new JMenuItem("Minimize");
window.add(minimize);
JMenu help = new JMenu("Help");
menuBar.add(application);
menuBar.add(edit);
menuBar.add(view);
menuBar.add(window);
menuBar.add(help);
JPanel panelRight = new JPanel(new GridLayout(1 ,2 ));
JMenu menu = new JMenu("Insomnia");
menu.setSize(100,60);
// menu.setBorder();
JPanel panelLeft = new JPanel(new BorderLayout());
panelLeft.add(menu , BorderLayout.NORTH);
JPanel panel = new JPanel(new BorderLayout());
panel.add(menuBar , BorderLayout.NORTH);
panel.add(panelLeft , BorderLayout.WEST);
panel.add(panelRight , BorderLayout.CENTER);
frame.getContentPane().add(panel);
}
}
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