Questions tagged [awt-eventqueue]

69 questions
14
votes
2 answers

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException Error

Hello I'm a new programmer at an high school level as a result I do not know much about programming and am getting quite a few errors which have been resolved while others I completely do not understand. I am to make a simple Check Box selection…
6
votes
2 answers

in java awt or swing, how can I arrange for keyboard input to go wherever the mouse is?

Working on a help system, I'd like each component to offer some help when the the mouse is over it and the "?" key is pressed. Sort of like tooltips, except with much more extensive help - essentially a little web browser is intended to pop up and…
ConorR
  • 427
  • 4
  • 9
4
votes
1 answer

Lag due to threads swapping

I have come across some recent lag spikes in a game I have been developing. It is consistent, happens around the same time. Using the java profiler jvisualvm I have found it occurs at the same time a particular thread seems to restart or something…
3
votes
1 answer

AWT-EventQueue thread and AWT-Shutdown thread not shutting down

The AWT-EventQueue thread and AWT-Shutdown thread are not shutting down in our application. Is there a debugging technique for finding out why they are not? Any special things to look for?
Paul Reiners
  • 8,896
  • 30
  • 107
  • 178
3
votes
1 answer

Swing: Component wont dissapear until I hover over the component

I am developing a small game in java swing as a small school project. I am done with all the logic and GUI. The game(Snakes and Stairs) has 36 squares(JButtons) and each of those have Jpanels inside that can be used to put the players piece…
Mr Krisey
  • 95
  • 1
  • 7
3
votes
1 answer

On Event Dispatch Thread---want to get off of it

Suppose that a method I own is sometimes called on the Event Dispatch Thread and is sometimes not. Now suppose some of the code in that method I want to have called on a thread other than the Event Dispatch Thread. Is there a way to run some code…
Paul Reiners
  • 8,896
  • 30
  • 107
  • 178
3
votes
1 answer

Java Event Queue : how to update component in JFrame

I have read about that when programming Java Swing, we should put these components into Java Event Queue, because Java Swing thread is not-thread safe. But, when I use Event Queue, I don't know how to update component properties (for example : set…
hqt
  • 27,058
  • 46
  • 161
  • 235
3
votes
2 answers

How to implement idle task in Java Swing

I have a GUI app that is getting to be quite slow. I want to start introducing timing for various GUI tasks - however, many of our GUI actions trigger other actions which then "invoke later" to trigger other actions. Eventually, it all settles down…
Paul Hollingsworth
  • 11,954
  • 12
  • 48
  • 66
2
votes
1 answer

How to run the animation thread for a Java Swing game from a launcher?

I am a bit new to threading, so bear with me. All relevant classes will be below the text in one place for easier reference. Backstory: I created a simple pong-like game following this tutorial: http://www.edu4java.com/en/game/game1.html Everything…
Rezkin
  • 279
  • 1
  • 5
  • 16
2
votes
2 answers

AWT-EventQueue not waking from Unsafe.park

We create an application that runs with several AppContexts. Now when one AppContext gets disposed, suddenly the remaining AWT-EventQueue doesn't get waked up on Swing Events anymore. So when I start the application and just have one EventQueue,…
roesslerj
  • 2,453
  • 5
  • 29
  • 43
2
votes
3 answers

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "1 "

I am very to new to Java programming and I am taking a class based on Java. I am currently doing this coffee project which is based on boolean and RadioButtons. I believe I am almost done with it except I get this error message on the console. If…
Warren Xie
  • 21
  • 1
  • 1
  • 2
1
vote
1 answer

Refresh Jframe on data change

I made a class that extends jframe. I have a border layout for the jframe and some components and a jpanel with absolute layout to hold some buttons and a jcombobox. The combo box holds some values from a table. And the table takes the values from a…
Vagelism
  • 601
  • 1
  • 13
  • 27
1
vote
1 answer

How to wait for radio button to get selected in lost focus event

I have a Swing program that does a search based on the contents of some text fields and settings of a pair of radio buttons (in a button group). The program will automatically search when certain of the text fields lose focus. The problem comes in…
Mitch
  • 899
  • 9
  • 23
1
vote
2 answers

AWT EventQqueue AccessControlException

I am pushing my own test event queue over the System eventqueue. And in TestEQueue I have over loaded the dispatchEvent method with one call to super.dispatchEvent TestEQueue mytestqueue = new TestEQueue(); …
Sirish
  • 7,948
  • 19
  • 61
  • 97
1
vote
1 answer

Java - How do you avoid a StackOverflow after creating multiple objects?

I am currently working on my exam-project for uni. The task is to create the boardgame ludo. After writing some code and doing some testing, I ran into a StackOverflowError. So here is the structure (5 classes are essential): Main.class GUI.class…
fl_sh
  • 31
  • 2
1
2 3 4 5