http://www.mo-music.org/autopc/ (this is the code and GUI images)
Here is a pasting of the source:
import java.io.*;
import javax.imageio.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class AutoPc {
public static void main(String args[]) {
ButtonFrame frame = new ButtonFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
// A frame with a button panel
class ButtonFrame extends JFrame {
public ButtonFrame() {
setTitle(frameTitle);
setSize(640,480);
// Add a panel to the frame
ImageButton gps_image = new ImageButton("v1.0GUI/GPS_BUTTON.gif");
ImageButton mp3_image = new ImageButton("v1.0GUI/MP3_BUTTON.gif");
ImageButton skin_image = new ImageButton("v1.0GUI/SKIN_BUTTON.gif");
ImageButton off_image = new ImageButton("v1.0GUI/OFF_BUTTON.gif");
ImageButton auto_pc_logo1 = new ImageButton("v1.0GUI/AUTO_PC1.gif");
ImageButton auto_pc_logo2 = new ImageButton("v1.0GUI/AUTO_PC2.gif");
ImageButton direction_bar = new
ImageButton("v1.0GUI/DIRECTION_BAR.gif");
ImageButton default_bg = new ImageButton("v1.0GUI/DEFAULT_BG.gif");
Container contentPane = getContentPane();
GridBagLayout layout = new GridBagLayout();
contentPane.setLayout(layout);
GridBagConstraints constraints = new GridBagConstraints();
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = 1;
constraints.gridheight = 1;
constraints.fill = GridBagConstraints.BOTH;
//constraints.anchor = GridBagConstraints.NORTH;
constraints.insets = new Insets(0,0,0,0);
contentPane.add(gps_image,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 1;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(mp3_image,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 2;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(skin_image,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 3;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(off_image,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 4;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(auto_pc_logo1,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 0;
constraints.gridy = 5;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(auto_pc_logo2,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 1;
constraints.gridy = 0;
constraints.gridwidth = 1;
constraints.gridheight = 5;
contentPane.add(default_bg,constraints);
constraints.weightx = 1;
constraints.weighty = 1;
constraints.gridx = 1;
constraints.gridy = 5;
constraints.gridwidth = 1;
constraints.gridheight = 1;
contentPane.add(direction_bar,constraints);
}
public static final String frameTitle = "Auto Pc v1.0 - Created By
MMS - www.autopc.com";
}
// Creating a panel to put buttons on
class ImageButton extends JPanel {
public ImageButton(String path) {
image_path = path;
// create buttons
JButton button = new JButton(new ImageIcon(image_path));
button.setBorderPainted(false);
button.setMargin(new Insets(0,0,0,0));
button.setOpaque(false);
add(button);
}
private JButton button;
private String image_path;
}
"Matt S" <ma...@sekelsky.com> wrote in message
news:a1c13a20.03052...@posting.google.com...
Thanks!
"M Series" <spa...@127.0.0.1> wrote in message news:<bb248i$foh$1...@newsg3.svr.pol.co.uk>...
> Changing the ipadx and ipady didn't do anything. Does anyone else have any ideas?
Did you try setting them to negative values ? Positive values will only
increase the spacing between images.
BK