I just installed Android Studio and started a simple application. A good start is an overorder, I was stuck on the first few lines and could not import JFrame into android studio.
I have the latest SDK with LibGDX installed. I still can not configure JFrame. I searched the network / youtube and no solutions were found.
I see javax and swing in my external libraries, but just can't import.
Any ideas what I'm doing wrong or not doing?
I'm not looking “like a textbook,” I'm just a pointer to where I should look for an answer.
wow, not a huge number of answers.
Please let me know if I asked a stupid question or a difficult question.
public hungryDog() {
JFrame jframe = new JFrame();
Timer timer = new Timer(20, this);
renderer = new Renderer();
rand = new Random();
jframe.add(renderer);
jframe.setTitle("Hungry Dog");
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setSize(WIDTH, HEIGHT);
jframe.addMouseListener(this);
jframe.addKeyListener(this);
jframe.setResizable(false);
jframe.setVisible(true);
dog = new Rectangle(WIDTH / 2 - 10, HEIGHT / 2 - 10, 20, 20);
columns = new ArrayList<Rectangle>();
addColumn(true);
addColumn(true);
addColumn(true);
addColumn(true);
timer.start();
}

source
share