Home > java > jDesktopPane Image Background

jDesktopPane Image Background

Banyak cara untuk dapat memasang background di jDesktopPane. Berikut trik yang mudah dilakukan dengan menggunakan IDE Netbeans.

1. Klik Custom Code pada jDesktopPane

2. Tambahkan Coding berikut:

ImageIcon icon = new ImageIcon(getClass().getResource("/icon/cat.jpg"));
Image image = icon.getImage();
desktopPane = new javax.swing.JDesktopPane() {

public void paintComponent(Graphics g) {
g.drawImage(image, 0, 0, getWidth(), getHeight(), this);


Screenshot from 2016-07-28 17-12-27

3. Done!

Screenshot from 2016-07-28 17-17-07

Selamat mencoba..

Categories: java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: