Commit b9da4776 authored by 9731301's avatar 9731301

complete menu items

parent b153bff8
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
<workItem from="1588522915548" duration="9323000" /> <workItem from="1588522915548" duration="9323000" />
<workItem from="1589030581229" duration="11616000" /> <workItem from="1589030581229" duration="11616000" />
<workItem from="1589063831974" duration="14071000" /> <workItem from="1589063831974" duration="14071000" />
<workItem from="1589215032092" duration="8311000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -88,29 +89,33 @@ ...@@ -88,29 +89,33 @@
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state x="309" y="122" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1589071976072" /> <state x="309" y="122" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1589071976072" />
<state width="1493" height="13" key="GridCell.Tab.0.bottom" timestamp="1589078975612"> <state width="1134" height="12" key="GridCell.Tab.0.bottom" timestamp="1589223456673">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="13" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1589078975612" /> <state width="1134" height="12" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1589223456673" />
<state width="1493" height="13" key="GridCell.Tab.0.center" timestamp="1589078975612"> <state width="1134" height="12" key="GridCell.Tab.0.center" timestamp="1589223456673">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="13" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1589078975612" /> <state width="1134" height="12" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1589223456673" />
<state width="1493" height="13" key="GridCell.Tab.0.left" timestamp="1589078975612"> <state width="1134" height="12" key="GridCell.Tab.0.left" timestamp="1589223456673">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="13" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1589078975612" /> <state width="1134" height="12" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1589223456673" />
<state width="1493" height="13" key="GridCell.Tab.0.right" timestamp="1589078975612"> <state width="1134" height="12" key="GridCell.Tab.0.right" timestamp="1589223456673">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state width="1493" height="13" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1589078975612" /> <state width="1134" height="12" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1589223456673" />
<state x="425" y="237" key="com.intellij.ide.util.TipDialog" timestamp="1589064073545"> <state x="425" y="237" key="com.intellij.ide.util.TipDialog" timestamp="1589215042759">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state x="425" y="237" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1589064073545" /> <state x="425" y="237" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1589215042759" />
<state x="46" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1588333540387"> <state x="163" y="189" key="run.anything.popup" timestamp="1589217529286">
<screen x="0" y="0" width="1536" height="824" /> <screen x="0" y="0" width="1536" height="824" />
</state> </state>
<state x="46" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1588333540387" /> <state x="163" y="189" key="run.anything.popup/0.0.1536.824@0.0.1536.824" timestamp="1589217529286" />
<state x="46" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1589216473471">
<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="1589216473471" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -3,10 +3,7 @@ import javafx.scene.transform.Shear; ...@@ -3,10 +3,7 @@ import javafx.scene.transform.Shear;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class InsomniaGUI { public class InsomniaGUI {
JFrame frame ; JFrame frame ;
...@@ -24,12 +21,86 @@ public class InsomniaGUI { ...@@ -24,12 +21,86 @@ public class InsomniaGUI {
JMenuBar upperMenuBar = new JMenuBar(); JMenuBar upperMenuBar = new JMenuBar();
JMenu application = new JMenu("Application"); JMenu application = new JMenu("Application");
JMenuItem OptionItem = new JMenuItem("Option");
OptionItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O , ActionEvent.CTRL_MASK));
JPanel optionPanel = new JPanel(new GridLayout(3,1));
JCheckBox followRedirect = new JCheckBox("follow redirect");
JCheckBox hideInSystemTray = new JCheckBox("hide in system tray");
String color []={"light theme","dark theme"};
JComboBox backGroundColor = new JComboBox(color);
backGroundColor.setFont(new Font("Arial",20,15 ));
optionPanel.add(followRedirect);
optionPanel.add(hideInSystemTray);
optionPanel.add(backGroundColor);
JFrame optionFrame= new JFrame("option");
optionFrame.setPreferredSize(new Dimension(100,100));
optionPanel.setPreferredSize(new Dimension(100,100));
optionFrame.add(optionPanel);
OptionItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
optionFrame.setVisible(true);
}
});
JMenuItem exitItem = new JMenuItem("Exit ");
exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,ActionEvent.ALT_MASK));
exitItem.addActionListener(new exitApp());
application.add(OptionItem);
application.add(exitItem);
JMenu edit = new JMenu("Edit"); JMenu edit = new JMenu("Edit");
edit.setMnemonic('e');
JMenu view = new JMenu("View"); JMenu view = new JMenu("View");
view.setMnemonic('v');
JMenuItem ToggleFullScreen = new JMenuItem("Toggle Full Screen");
ToggleFullScreen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T , KeyEvent.VK_F));
JMenuItem ToggleSidebar = new JMenuItem("Toggle Sidebar");
ToggleSidebar.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L ,KeyEvent.VK_S ));
view.add(ToggleFullScreen);
view.add(ToggleSidebar);
JMenu window = new JMenu("Tools"); JMenu window = new JMenu("Tools");
window.setMnemonic('w');
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");
help.setMnemonic('h');
JMenuItem aboutItem = new JMenuItem("About");
aboutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A , ActionEvent.CTRL_MASK));
aboutItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JPanel aboutPanel = new JPanel();
JTextArea aboutText = new JTextArea();
aboutText.setEditable(false);
aboutText.setText("developer\tzahra seyedFatehi \nEmail \ts.fatehi1378@Gmail.com\nstudent number\t9731301");
aboutPanel.add(aboutText);
aboutText.setPreferredSize(new Dimension(300,200));
JFrame frame = new JFrame("About");
frame.setLocation(100,100);
frame.setPreferredSize(new Dimension(200,200));
frame.add(aboutPanel);
frame.setVisible(true);
}
});
help.add( aboutItem);
JMenuItem helpItem= new JMenuItem("help");
helpItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H , ActionEvent.CTRL_MASK));
helpItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JPanel helpPanel = new JPanel();
JTextArea helpText = new JTextArea();
helpPanel.add(helpText);
frame.setLocation(100,100);
frame.setPreferredSize(new Dimension(200,200));
frame.add(helpPanel);
frame.setVisible(true);
}
});
help.add(helpItem);
upperMenuBar.add(application); upperMenuBar.add(application);
upperMenuBar.add(edit); upperMenuBar.add(edit);
upperMenuBar.add(view); upperMenuBar.add(view);
...@@ -326,4 +397,12 @@ public class InsomniaGUI { ...@@ -326,4 +397,12 @@ public class InsomniaGUI {
} }
} }
} }
// Exit app
static class exitApp implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
} }
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