Thread « JFrame « Java Swing Q&A





1. Why wont my JFrame hide?    stackoverflow.com

I'm in the process of creating a GUI in Netbeans 6.1 for my senior design project but i've run into an annoying snag. Temporary Windows like my login PopUp and ...

2. Knowing when a JFrame is fully drawn    stackoverflow.com

I have a program that creates a JFrame and makes it visible. Is there anyway to know when the JFrame is fully drawn and visible? Right now a hacky "wait and ...

3. Multithreading in JFrames    stackoverflow.com

I want to display an image as welll as some text on my JFrame in a way that both get displayed simultaneously part by part. I have implemented it but not ...

4. How do I make a thread wait for JFrame to close in Java?    stackoverflow.com

When the program starts, a new JFrame is created. Once the user clicks the start button a thread is created and started. Part of this threads execution is to validate the ...

5. Is it safe to dispose a JFrame from a different thread in Java?    stackoverflow.com

Is it safe to call the dispose() method of a JFrame from a different thread (not the EDT)?

6. What is this thread/paint exception about?    stackoverflow.com

I'm playing with things I don't really understand at the moment for a JAVA project on a Robot exploring an unknown territory (a grid of valid positions and blocked positions). Anyway, ...

7. Instantiated components from within a thread aren't repainting into a JFrame in Java    stackoverflow.com

I have a single class like this one

public class BlockSpawner implements Runnable{

public static long timeToSpawn;
private GtrisJFrame frame;

public BlockSpawner(GtrisJFrame frame)
{

    this.frame = frame;
    timeToSpawn = 2000;
}

public ...

8. Java CountDownLatch used to wait for JFrame to dispose    stackoverflow.com

I have referenced this previous question as well as other sources, but cannot get CountDownLatch to work correctly. Background: mainFrame creates new Frame called dataEntryFrame. When dataEntryFrame "Submit" ...

9. Getting data from JFrame AFTER the form is filled    stackoverflow.com

I'm trying to get data for my application from a form set in an external window (getDataWindow extends javax.swing.JFrame). The problem is that functions are executed before form is filled in.

 ...





10. java swing thread problem    stackoverflow.com

In my java swing application am having a Jframe and Jlabel for displaying current time. here am using a thread for displaying time in jlablel which is added to the frame.my doubt ...

11. Update JFrame with thread? - Java    stackoverflow.com

I have asked this question so many times and have tried so many different things that I don't know where to turn. Could someone please write a program for me to show ...

12. Creating JFrame in a new Thread(new messageloog)    stackoverflow.com

Hi i am trying to create multi JFrames but I want each one to has its own Thread (message loop) ,so when one JFrame freezes the others will keep working i tried ...

13. What is the cause and resolution of java.lang.ExceptionInInitializerError error when trying to open a JFrame in another Thread?    stackoverflow.com

I'm trying to creating a test class to open a JFrame. In order to stop the window from closing the moment the main thread finishes I added the code to open ...

14. how to implement multithreading for jframe    stackoverflow.com

I am using this code for implementing multithreading :

class Progress extends JFrame implements Runnable {
  Thread t;
JProgressBar current;
JTextArea out;
JButton find;
Thread runner;
JFrame tframe;
int num = 0;

public Progress() {
    ...

15. How to make the main GUI thread 'wait' until a separate pop-up window is disappeared    stackoverflow.com

I have an object which is invoked from the main GUI thread and shows a separate JFrame for a number of seconds and then disappear (with the use of a timer). ...

16. How should I shut down and restart a Swing JFrame thread    stackoverflow.com

My application's main frame starts a JFrame thread:

IBM1622GUI cardReadPunchGUI = new IBM1622GUI(); // instantiate
Thread cardReadPunchThread = new Thread(cardReadPunchGUI); // alloc thread
cardReadPunchThread.start(); // call thread's run() method
Later, the main frame needs to ...





17. Why after creating a JFrame object and setting it as visible, the program will not end executing?    stackoverflow.com

My program looks like this:

import java.awt.*;
import javax.swing.*;

public class Main {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
 ...

18. Threads and JFrame program.    forums.netbeans.org

Hello everyone. I'm a student, and I've recently picked up on Java again after 2-3 years of not working with it at all. So at school we were left homework consisting ...

19. JFrame not refreshing    coderanch.com

Hello everybody, We have developed a chat kinda application. This is primarily meant to send some message to 1/many people at the same time. The GUI is something of this sort ----------------------------------------| | | | | ----------------------------------------| | | | | ---------------------------------------- The user types something in the lower window(which is is text area). Now this massage may be meant for ...

20. JFrame    coderanch.com

22. How to handle Modal Frame and Runnable thread simultaneously    coderanch.com

I am sending the request to the server, till the response comes modal dialog box appears as soon as response comes it update the jtable and close the dialog box Runnable run = new runnable() { public void run() { // req send to server and after receiving the response, it update into the table //modal dialog box dispose } }; ...

23. Help - Resetting a JFrame    coderanch.com

Hi Wondering if someone can help me here. I have a little link program that stores the data for the links in a file and i have built a preference panel that allows you to edit the data how ever i would like to make it so you can edit the data and effect the changes into the current running instance. ...

24. Instantiated components from within a thread arent repainting into a JFrame in Java    coderanch.com

NOTE: This thread is already at GameDev forum, but I think this problem should be of interest also in this forum. Thanks for your comprehension over this n00b. Hi guys, I'm making this tetris variation, a piece should be spawned every 2 secs. I try to construct this piece (Block) from within a thread like this: public void run() { public ...

26. simultaneosly running server class and JFrame, the JFrame wont show the components.    coderanch.com

SERVER import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class Server extends Thread { private ServerSocket server; private int port = 7777; Server() { try { server = new ServerSocket(port); } catch (IOException e) { e.printStackTrace(); } } public void handleConnection() { while (true) { try { Socket socket = server.accept(); new ConnectionHandler(socket); } catch (IOException e) { e.printStackTrace(); } } } ...

27. is it a single thread or multiple thread for different jframe    coderanch.com

It should all run under one thread, the Event Dispatch Thread. Essentially what happens is when you hit a button or some other action or event or whatever happens in Swing, it gets added to a queue of events which Swing needs to handle. The Event Dispatch Thread takes one of these events out of the queue at a time, and ...

28. Jdk1.6 setCursor() with EventQueque thread showing Hourglass on parent window after closing frame    coderanch.com

Hi, In our application we using swing cursor when processing data using below snippet code in parent-child window. try{ component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Code for processing // code }catch (Exception e) { e.printStackTrace(); }finally{ component.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } Code reset cursor back to default after logic processing without any exception. But after closing this child frame by close event or clicking some control on this ...

29. JFrame created but window contents not showing, othr threads keep waiting on the user    java-forums.org

JFrame created but window contents not showing, othr threads keep waiting on the user JFrame created but window contents not showing, othr threads keep waiting on the user input thatll never happn? this is all Java (1.6) code This window is created when I create a Win_TF_Layout myInputWindow = new Win_TF_Layout("Enter First and Last Name"); However, the contents of ...

30. JFrame hangs tried additional threading but no use    java-forums.org

class plzwai extends JFrame implements Runnable { Thread t=new Thread(this); plzwai() { t.start(); } public void run() { fplz=new JFrame("Information"); lplz=new JLabel("Uploading Files Please Wait..... Do not close this application while uploading files as it can harm your computer speed"); fplz.add(new JPanel(),BorderLayout.NORTH); fplz.add(new JPanel(),BorderLayout.SOUTH); fplz.add(new JPanel(),BorderLayout.EAST); fplz.add(new JPanel(),BorderLayout.WEST); fplz.add(lplz,BorderLayout.CENTER); fplz.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { new plzwai(); } }); ...

31. Combination of Threads and Frames    java-forums.org

I wasn't sure if I should post this under Threads and Synchronization or AWT/Swing because I feel like it falls under both categories. I apologize if it's in the wrong one :eek: Here's the scenario though: I have a JFrame with a number of JPanels on it. When you click on one of the JPanels, it needs to open up another ...

32. Thread Safety - JFrames and UIs    forums.oracle.com

If I understand it correctly, the guidling principle to 'thread safety' is to separate the classes for user interfaces and the logic behind the interfaces. So, what I've been doing is to set up pairs of classes; one for the user interface (JFrame, JPanel, JTextBox, layout etc) and another 'checker' class (with regexes, logic etc) to interpret the inputs into the ...

33. Thread and GUI Window!    forums.oracle.com

34. Using Thread.sleep() in a JFrame    forums.oracle.com

Hi all! I'm writing a Black Jack game in Java. When it is computer's turn, I want it to deal a card, show it, wait a second and deal the next card, and so on... I tried using Thread.sleep(1000), but even if I wrote to change the cardLabel's icon, the JFrame completely freezes, and only the last dealed card is shown. ...

35. Trying to get multiple threads working with a JFrame, Whats wrong?    forums.oracle.com

Your main method creates two Drawing objects, one which is shown, and one which is not. Only the second one uses the constructor which spawns a second thread. In the code you've given, for the object which is not shown but does run a thread, panDraw is null, so you get 'true' output and a NullPointerException (if you make a dummy ...

37. Threads in JFrames    forums.oracle.com