2828import java .net .URI ;
2929import java .net .URISyntaxException ;
3030import java .util .ArrayList ;
31+ import java .util .Enumeration ;
32+ import java .util .jar .JarEntry ;
33+ import java .util .jar .JarFile ;
3134
3235import javax .swing .BorderFactory ;
3336import javax .swing .JButton ;
3437import javax .swing .JFileChooser ;
3538import javax .swing .JFrame ;
39+ import javax .swing .JLabel ;
3640import javax .swing .JMenu ;
3741import javax .swing .JMenuBar ;
3842import javax .swing .JMenuItem ;
5155
5256import com .devkev .devscript .raw .ApplicationInput ;
5357import com .devkev .devscript .raw .ApplicationListener ;
58+ import com .devkev .devscript .raw .ConsoleMain ;
5459import com .devkev .devscript .raw .Output ;
5560import com .devkev .devscript .raw .Process ;
5661
@@ -74,6 +79,8 @@ public class Window {
7479 private int historyIndex = 0 ;
7580 public int maxHistorySize = 50 ;
7681
82+ JLabel commandPreview ;
83+
7784 public Window () {
7885 try {
7986 UIManager .setLookAndFeel ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
@@ -148,7 +155,7 @@ public boolean dispatchKeyEvent(KeyEvent e) {
148155
149156 JMenu m = new JMenu ("File" );
150157
151- JMenuItem newFile = new JMenuItem ("New" );
158+ JMenuItem newFile = new JMenuItem ("New... " );
152159 newFile .setAccelerator (KeyStroke .getKeyStroke ("control N" ));
153160 newFile .addActionListener (new ActionListener () {
154161 public void actionPerformed (ActionEvent e ) {
@@ -158,6 +165,8 @@ public void actionPerformed(ActionEvent e) {
158165 }
159166 });
160167 m .add (newFile );
168+ m .addSeparator ();
169+
161170
162171 JMenuItem loadFile = new JMenuItem (getFormattedBarText ("Open..." ));
163172 loadFile .setAccelerator (KeyStroke .getKeyStroke ("control O" ));
@@ -190,7 +199,7 @@ public void actionPerformed(ActionEvent e) {
190199 }
191200 });
192201 m .add (loadFile );
193- JMenuItem saveFile = new JMenuItem ("Save File" );
202+ JMenuItem saveFile = new JMenuItem ("Save File... " );
194203 saveFile .setAccelerator (KeyStroke .getKeyStroke ("control S" ));
195204 saveFile .addActionListener (new ActionListener () {
196205 public void actionPerformed (ActionEvent e ) {
@@ -349,6 +358,32 @@ public void keyPressed(KeyEvent e) {}
349358 pane .setBorder (BorderFactory .createLineBorder (Color .BLACK ));
350359 window .add (pane );
351360
361+ commandPreview = new JLabel ("This is a test" );
362+ commandPreview .setBorder (BorderFactory .createLineBorder (Color .black , 2 ));
363+ commandPreview .setBackground (Color .lightGray );
364+ commandPreview .setBounds (20 , 20 , 100 , 40 );
365+ commandPreview .setLocation (30 , 30 );
366+ commandPreview .addKeyListener (new KeyListener () {
367+ @ Override
368+ public void keyTyped (KeyEvent e ) {
369+
370+ }
371+
372+ @ Override
373+ public void keyReleased (KeyEvent e ) {
374+ }
375+
376+ @ Override
377+ public void keyPressed (KeyEvent e ) {
378+ System .out .println (e .getKeyCode ());
379+ if (e .isControlDown () && e .getKeyCode () == KeyEvent .VK_SPACE ) {
380+ System .out .println ("PReview!" );
381+ }
382+ }
383+ });
384+ commandPreview .setVisible (true );
385+ window .add (commandPreview );
386+
352387 initRunWindow ();
353388 window .pack ();
354389 window .setSize (500 , 500 );
0 commit comments