import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class LeftSide { public LeftSide() { JFrame frame = new JFrame("Button"); JPanel panel = new JPanel(); JButton button = new JButton("Submit"); button.setPreferredSize(new Dimension(200, 30)); button.setIcon(new ImageIcon(this.getClass().getResource("submit.gif"))); panel.add(button); frame.add(panel); frame.setVisible(true); } public static void main(String[] args) { new LeftSide(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter