Skip to content

Commit

Permalink
Fix JButton margin on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
aitjcize committed Oct 20, 2011
1 parent 62a598f commit 293541e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/org/zeroxlab/aster/ActionDashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.GridLayout;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JPanel;

Expand All @@ -46,6 +47,10 @@ private ActionDashboard () {
mStep = new JButton("Step");
mStop = new JButton("Stop");
setLayout(new GridLayout(1, 3));
Insets insets = new Insets(0, 0, 0, 0);
mPlay.setMargin(insets);
mStep.setMargin(insets);
mStop.setMargin(insets);
add(mPlay);
add(mStep);
add(mStop);
Expand Down
8 changes: 8 additions & 0 deletions src/org/zeroxlab/aster/AsterWorkspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.io.IOException;
Expand Down Expand Up @@ -172,7 +173,9 @@ public void actionPerformed(ActionEvent e) {
sDone.setEnabled(false);
add(sDone);

Insets insets = new Insets(0, 0, 0, 0);
sRotate = new JCheckBox("Rotate");
sRotate.setMargin(insets);
sRotate.setSize(80, 20);
sRotate.setForeground(Color.WHITE);
add(sRotate);
Expand All @@ -183,14 +186,19 @@ public void actionPerformed(ActionEvent e) {

private JComponent initShortcutButtons() {
ImageIcon icon;
Insets insets = new Insets(0, 4, 0, 4);
icon = createScaledIcon("/btn_back.png", MK_WIDTH, MK_HEIGHT);
sBack = new JButton(icon);
sBack.setMargin(insets);
icon = createScaledIcon("/btn_menu.png", MK_WIDTH, MK_HEIGHT);
sMenu = new JButton(icon);
sMenu.setMargin(insets);
icon = createScaledIcon("/btn_home.png", MK_WIDTH, MK_HEIGHT);
sHome = new JButton(icon);
sHome.setMargin(insets);
icon = createScaledIcon("/btn_search.png", MK_WIDTH, MK_HEIGHT);
sSearch = new JButton(icon);
sSearch.setMargin(insets);

MainKeyMonitor monitor = new MainKeyMonitor();
sBack.addActionListener(monitor);
Expand Down

0 comments on commit 293541e

Please sign in to comment.