Paul
Paul

Reputation: 968

Gif image display ugly in JLabel in Java?

I'm not so new to Java but I'm having a weird prolem with JLabel.

My Problem:

The gif image displayed in JLabel is too fast, laggy and ugly. But looping, animation... are Ok

What I have tried:

My Code:

jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/waiting.gif")));

Could someone please give me an advice?.

Thank you.

Upvotes: 1

Views: 874

Answers (2)

Slipstream
Slipstream

Reputation: 14762

Edit the image and check that the foreground is transparent. Also change the jLabel foreground to white or equal to the main-background where it is inserted.

Upvotes: 0

Schnodderbalken
Schnodderbalken

Reputation: 3467

GIF animation plays extremely fast in JFrame sounds pretty much like your problem. You may need an external library to control the play speed.

Upvotes: 1

Related Questions