Search:

Type: Posts; User: Toldry

Search: Search took 0.15 seconds.

  1. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    public class Repainter extends Thread
    {

    public void run()
    {
    while (true)
    {
    repaint();
    try
    {
  2. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    I managed to find how to make rainbow colors from
    Create a rainbow with GD

    But now I have two new problems (because of the exception I posted above)
    1. My repainter thread doesn't work
    2. I...
  3. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    I used your method and now I'm getting "java.lang.IllegalMonitorStateException"
  4. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    Unrelated problem:
    Assuming I have a variable that goes from 0 to 1, how do I use it and the class Color to get a rainbow spectrum? (0=red, 1=violet)
  5. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    Here:


    import java.util.logging.Level;
    import java.util.logging.Logger;

    public class ThreadProblem
    {
  6. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    Here's my project
    https://dl.dropbox.com/u/73680434/Simple%20Graphics.rar
  7. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    These are the relevant functions


    public MyCanvas()
    {
    setSize(width, height);
    setVisible(true);
    ren.setWindow(-2.2,1.3,3.4,2.6);

    ...
  8. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    Right... never mind, I managed to solve my problem.

    But I have a new one now regarding threads; I'm trying to activate two threads at the same time, one that repaints every half second and another...
  9. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    I put a line in the start of the function paint()

    System.out.println("Painting");

    (not in the version I posted above)

    and it prints that three times

    edit: three times, not twice
  10. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    My question is why my code calls the paint() function multiple times
  11. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    Then it's in a GUI class because I can see it on my screen. (which is the entire point of this program)
    How does the JVM determine when the GUI needs to be drawn?

    For some reason the paint()...
  12. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    I might as well post all the code I have so far



    package Mendelbrot;


    import java.awt.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
  13. Replies
    25
    Views
    770

    Re: I'm new to JFrame and need some help

    I'm fresh out of highschool in terms of my java knowledge, so I don't know much yet

    In your post I don't know what these terms are:

    GUI class
    JVM
    Java SE
    swing class
  14. Replies
    25
    Views
    770

    I'm new to JFrame and need some help

    Basically, to familiarize myself with this class I'm doing my first project, which is drawing the Mendelbrot Set, but before that I have to handle much simpler things;

    If I have a the class ...
Results 1 to 14 of 14