How can you get a custom background image for a Jframe

Joined
Jan 4, 2011
Messages
1
Reaction score
0
Hi, my problem is i'm trying to get a custom background for my frame, everything else works with my program and i tried a bunch of different methods but none seem to work. This is the part of my program that displays the first button and i got a custom background color, so can anyone tell me wat i should add.

import javax.swing.*;
import java.awt.*;

import javax.swing.JFrame;
public class ISU{
public static void main(String[] args){
Button1 go = new Button1();
go.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
go.setSize(280,190);
go.getContentPane().setBackground(Color.BLACK);//part i need to change
go.setVisible(true);
}
}
:withstup:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top