Skip to content
Advertisement

Tag: jframe

Recover data after closing a Jar file

I am working with a jar file that deals with a program where I open a window (using JFrame). In this window, I manipulate some data and store some of it in the private fields of a class. When I close my windows and reopen my jar file, all my data is lost. How can I save my data so

How do I change the background color of a JFrame dynamically?

I was wondering how would I change this block of code to be able to have a dynamically changing background colour that switches from (red -> black -> green -> black -> blue -> black ->red) and the loop starts again. The background colour should be continuously changing per tick. Right now I have a render method that will continuously

I have a problem whith adding a Container in a JFrame

I am a student in informatics and beginning in Java, I want to create a project which will allow me to make a calculator. I am encountering a problem which is the following: I want to add Container in my JFrame with add(contenu), but it gives me the following warning : I don’t understand why this problem appears. Here are

Highest performance for Keyboard Input

So I have a small java game engine using a single JFrame. I am currently using Key-Bindings as they were working neatly but I figured that a KeyListener might be architecturally more fitting. But since I honestly don’t really care which I’ll use I wanted to ask if there is a performance difference between these or even a better option

Java – How do I get an image to display?

I have spent a really long time trying to find a way to display an image in a Java program (I’m trying to learn how to make a 2D Java game) an nothing that I’ve tried works. I’m using Eclipse Mars and the latest of everything else. Here is my code: Please, just tell me how to correct the code

Advertisement