Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

System specs and code sample in the end of this contribution!

First of all, I am new to this forum. Please tell me if there is anything wrong with the layout or the question itself. I am also new to linux, ubuntu and kind of a newbie at java. I was using windows 7 before ubuntu. The problem appeared first after installing ubuntu on my machine.


When running animation windows in eclipse, using the swing package or java applet - the animation is jumpy and not smooth. I will show you a sample from my code of a very simple program that consists of a JPanel and a JFrame with a background and a 2d-ball moving from left to right. The program is set to repaint every 30 ms. It shouldn't be a problem to run simple graphics like this. Eclipse is fast and smooth otherwise. Would appreciate any help or advice, if someone has encountered something like this before!

What i tried

*searching for bugs or problems related to this, but not finding any

*Installing the latest versions of Eclipse and the latest JDK

*Editing my eclipse.ini file

*running my code on My Windows 7 machine (Works fine)

*installing bumblebee and using nvidia optimus


OS: Ubuntu 12.04 (precise) 64-bit

Memory: 5.6 GiB, Processor intel Core 2.5 GHz x 4 CPU

Eclipse Juno 4.2.0

java version brings me

$ -java version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

my eclipse.ini file





Code sample

/////////Sample from the JPanel class /////////

private int y = 200;
private int x = 0;

public testPanel() {
setPreferredSize(new Dimension(1500,400));

public void move() {
x = x+2;

public void paintComponent(Graphics g) {

///////Sample from the JFrame class /////////

private testPanel thePanel = new testPanel();
private Timer t = new Timer(30,this);

public testFrame() {


public void actionPerformed(ActionEvent e) {

Edit: Adding an exception: When i hover with my mouse ( and keep moving it ) over the application window the animation stops beeing jumpy. when i stop moving, it starts beeing not smooth and jumpy again. Anyone heard of this?

share|improve this question
First off, the layout is great! Secondly: do you have any Graphics driver installed? Because currently it might be rendered on your CPU which makes it jumpy. – BeryJu May 10 '13 at 15:52
if i run lspci | grep VGA i get VGA compatible controller: Intel Corporation Ivy Bridge Graphics Controller (rev 09) – lsund May 11 '13 at 7:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.