Search:

Type: Posts; User: evert67

Search: Search took 0.40 seconds.

  1. Re: Is there a way to specify where on screen a JFrame or a JDialog should appear?

    Well, I discovered the reason...

    One can easily center a JFrame such that its center coincides with the center of the component c that creates it. Simply use the statement...
  2. Re: Is there a way to specify where on screen a JFrame or a JDialog should appear?

    Thanks. That was useful advice. It was a bit of searching between all the different methods of JFrame and its friends, but I found it.

    The location of a JOptionpane (which I use quite a lot) can...
  3. What is a good book to learn Android programming?

    I've managed to teach myself Java and I'm now moving on to Android development. I taught myself Java using a book (Sams Java in 21 days) and I like this a lot better than using online material only....
  4. Is there a way to specify where on screen a JFrame or a JDialog should appear?

    The title says it all.

    I've got a program that uses a few JFrames and JDialogs. The main window is a JFrame and always appears in the top left corner of the screen. The same applies to all other...
  5. Re: SwingWorker implemented - how to do additional GUI processing?

    Ah, that's it! The done method works. I also just found it in the Oracle docs :-).

    Thanks!

    Just don't always believe Teach yourself Java in 21 days (a pretty decent book otherwise).
  6. Re: SwingWorker implemented - how to do additional GUI processing?

    I fire off the GUI as follows:



    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    ViewController_Graphics view = new...
  7. Re: SwingWorker implemented - how to do additional GUI processing?

    OK, I understand that classes or objects don't run on threads. I didn't express myself carefully enough. I'm teaching myself Java with two books: Teach yourself Java in 21 days (Cadenhead) and...
  8. Re: SwingWorker implemented - how to do additional GUI processing?

    Thanks. But I don't understand this.

    1) I'd like the user to be able to press a Cancel button before the worker threat has finished. The property change listener is only called after the worker...
  9. SwingWorker implemented - how to do additional GUI processing?

    In a previous question I asked how I could implement processor-intensive work, which was called by a Swing component, without the GUI locking up. I was then pointed to the SwingWorker class. I...
  10. Re: How to "split off" processor-intensive calculations in Swing ActionListener?

    Thanks. I'll read more about SwingWorker.

    Just to be sure. My UI code (class ViewController_Graphics) is invoked as follows:



    SwingUtilities.invokeLater(new Runnable() {
    ...
  11. How to "split off" processor-intensive calculations in Swing ActionListener?

    I am writing a program to solve Sudoku puzzles. My user interface is written in Swing.

    When a user presses a "Solve" button, an ActionListener for this button is called. This ActionListener...
  12. Re: How does repaint work in combination with paintComponent (Graphics class)?

    I already messed with the code. What I found out is that the code actually works as if the first repaint removes the red box: if you remove that line, the red box remains displayed also at its old...
  13. Re: Why should Swing GUI code be placed on the EDT?

    Do I also need to use the above code (explicitly put the Swing code on the EDT) if my entire program runs in one threat, i.e. my program never explicitly creates any threats?
  14. Re: How does repaint work in combination with paintComponent (Graphics class)?

    Thanks, this clarifies it a bit. But what I still don't understand is how the first invocation of repaint causes the red box to be wiped out.
  15. Re: Why should Swing GUI code be placed on the EDT?

    As I wrote in the other topic: are these forums somehow connected and, if so, is there a preferred place?
  16. Re: How does repaint work in combination with paintComponent (Graphics class)?

    Yup. Are these forums somehow connected and, if so, is there a preferred place?
  17. Why should Swing GUI code be placed on the EDT?

    According to what I read, “when programming in Swing, your GUI creation code should be placed on the Event Dispatch Thread (EDT). This will prevent potential race conditions that could lead to...
  18. How does repaint work in combination with paintComponent (Graphics class)?

    I’m teaching myself AWT/Swing using an Oracle tutorial. There’s a section a don’t fully understand.

    It concerns an application that creates dynamic graphics using the Graphics class. I understand...
  19. Re: How to set (minimum) panel size for panel with a Graphics2D object only?

    Yes, I read that later. Which is the preferred method, override getPreferredSize() or use setMinimumSize() ?
  20. Re: How to set (minimum) panel size for panel with a Graphics2D object only?

    Thanks a lot! It works!
  21. How to set (minimum) panel size for panel with a Graphics2D object only?

    I am writing a program to solve Sudoku puzzles. I create the user interface using AWT/Swing.

    One panel of the main window (JFrame object) contains a Graphics2D component only (a grid for the...
  22. View Post

    Thanks both! Very useful information!
  23. View Post

    I’m teaching myself Java. I am a fairly proficient programmer in other languages, but this is the first OO language I’m doing.

    I have a question that is a bit hard to summarize. Or it should be:...
  24. Re: Looking for good book that teaches Java with Eclipse as development environment

    Thanks all! I've started learning Java using Notepad++ :-) .

    I will be using Eclipse in some time, though. The reason is that I want to do Android programming.

    Does anyone know of a good and...
  25. Looking for good book that teaches Java with Eclipse as development environment

    Hi all,

    I'm Evert, born in 1967 as the name says :-) .

    I want to teach myself Java. Should be possible, since I have plenty of experience in other programming languages.

    Since I want to use...
Results 1 to 25 of 25