Skip to content

Commit 9accc47

Browse files
committed
Move options and actions to a menu bar; Yay.
Related to issue #6.
1 parent a0147e6 commit 9accc47

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

src/com/ggtracker/uploader/MainFrame.java

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import java.awt.Color;
1414
import java.awt.FlowLayout;
1515
import java.awt.Frame;
16+
import java.awt.Menu;
17+
import java.awt.MenuBar;
18+
import java.awt.MenuItem;
1619
import java.awt.event.ActionEvent;
1720
import java.awt.event.ActionListener;
1821
import java.awt.event.WindowAdapter;
@@ -155,18 +158,40 @@ public void actionPerformed( final ActionEvent event ) {
155158
contentBox.add( wrapper );
156159

157160
// ACTIONS
158-
159-
contentBox.add( Box.createVerticalStrut( SPACING ) );
160-
wrapper = new JPanel( new FlowLayout( FlowLayout.RIGHT, 0, 0 ) );
161-
final JButton exitButton = new JButton( "Quit and Stop Uploading Replays" );
162-
exitButton.addActionListener( new ActionListener() {
161+
MenuBar menubar = new MenuBar();
162+
Menu file = new Menu("File");
163+
MenuItem replays = new MenuItem("View Replays");
164+
MenuItem logs = new MenuItem("View Logs");
165+
MenuItem exit = new MenuItem("Exit");
166+
exit.addActionListener( new ActionListener() {
163167
@Override
164168
public void actionPerformed( final ActionEvent event ) {
165169
GgtrackerUploader.exit();
166170
}
167171
} );
168-
wrapper.add( exitButton );
169-
wrapper.add( Box.createHorizontalStrut( 3 ) );
172+
file.add(replays);
173+
file.add(logs);
174+
file.add(exit);
175+
176+
Menu help = new Menu("Help");
177+
MenuItem faq = new MenuItem("Online Help");
178+
help.add(faq);
179+
180+
menubar.add(file);
181+
menubar.add(help);
182+
setMenuBar(menubar);
183+
184+
contentBox.add( Box.createVerticalStrut( SPACING ) );
185+
wrapper = new JPanel( new FlowLayout( FlowLayout.RIGHT, 0, 0 ) );
186+
// final JButton exitButton = new JButton( "Quit and Stop Uploading Replays" );
187+
// exitButton.addActionListener( new ActionListener() {
188+
// @Override
189+
// public void actionPerformed( final ActionEvent event ) {
190+
// GgtrackerUploader.exit();
191+
// }
192+
// } );
193+
// wrapper.add( exitButton );
194+
// wrapper.add( Box.createHorizontalStrut( 3 ) );
170195
wrapper.add( Utils.createLinkLabel( Consts.APP_VERSION, Consts.URL_HOME_PAGE ) );
171196
contentBox.add( wrapper );
172197

0 commit comments

Comments
 (0)