Help with making a small game
hello ,
i'm trying to make a small game ,
i never done this before and got mixed up in the menus
i tried to make a background image and it worked
now i'm trying to put a jbutton on the background picture
and it won't show i'm guessing it's not on top
any ideas how to solve it ?
here's what i did to get the background image
Code :
public class Main extends javax.swing.JFrame {
/**
* Creates new form Main
*/
public Main() {
initComponents();
jToggleButton1.setVisible(true);
Dimension d= java.awt.Toolkit.getDefaultToolkit().getScreenSize();
this.setExtendedState(Main.MAXIMIZED_BOTH);
ImageIcon icon = new ImageIcon("images/c.jpg");
Image image = icon.getImage();
image = getScaledImage(image ,d.width ,d.height);
icon.setImage(image);
JLabel pic = new JLabel(new ImageIcon(image));
this.setContentPane(pic);
this.pack();
}
thanks to all helpers !
Re: Help with making a small game
The posted code does not compile without errors.
Can you make a small simple program that compiles, executes and shows the problem?