Click here to Skip to main content
15,920,005 members
Home / Discussions / Java
   

Java

 
AnswerRe: Enterprise java bean help Pin
ISoftwareDev23-May-09 10:53
ISoftwareDev23-May-09 10:53 
QuestionDefect per KLOC in java?? Pin
Maya_15-May-09 1:36
Maya_15-May-09 1:36 
AnswerRe: Defect per KLOC in java?? Pin
Nagy Vilmos19-May-09 1:03
professionalNagy Vilmos19-May-09 1:03 
GeneralRe: Defect per KLOC in java?? Pin
Maya_19-May-09 1:22
Maya_19-May-09 1:22 
QuestionJScrollPane child dimesniosn not updating Pin
rareseu14-May-09 5:01
rareseu14-May-09 5:01 
AnswerRe: JScrollPane child dimesniosn not updating Pin
Nagy Vilmos14-May-09 5:45
professionalNagy Vilmos14-May-09 5:45 
GeneralRe: JScrollPane child dimesniosn not updating Pin
rareseu14-May-09 6:30
rareseu14-May-09 6:30 
GeneralRe: JScrollPane child dimesniosn not updating Pin
Nagy Vilmos14-May-09 22:05
professionalNagy Vilmos14-May-09 22:05 
All your code is doing is painting a circle at the LAST position. The repaint needs to paint EVERY circle.

The simplest approach is to have a collection of objects each representing on of the thing you wish to display.
Each class knows how and where to piant itself on a given graphic:
[this code is not tested]
// you need a 'circle' class
class MyCircle
{
  private int top;
  private int left;
  private int radius; // don't need two vars here

  MyCircle (int top, int left, int radius)
  {
    this.top = top;
    this.left = left;
    this.radius = radius;
  }

  void Repaint (Graphic g)
  {
    g.setColor(Color.BLUE);
    g.fillOval(this.top,
               this.left,
               this.radius,
               this.radius);
  }
}


As you add your curcles create a new object with the X,Y,R. Hold these in a list object.
On the scrollpane repant iterate through the list and paint each object.



Panic, Chaos, Destruction.
My work here is done.

GeneralRe: JScrollPane child dimesniosn not updating Pin
rareseu14-May-09 22:38
rareseu14-May-09 22:38 
Questionrelated ro mobile Pin
raghvendrapanda13-May-09 20:44
raghvendrapanda13-May-09 20:44 
AnswerRe: related ro mobile Pin
Nagy Vilmos14-May-09 2:48
professionalNagy Vilmos14-May-09 2:48 
QuestionRetrieving public key for encryption from digital certificate Pin
shrims4u13-May-09 4:37
shrims4u13-May-09 4:37 
QuestionJava Event Handling Flow ??? Pin
Zealous_Me10-May-09 6:56
Zealous_Me10-May-09 6:56 
AnswerRe: Java Event Handling Flow ??? Pin
Nagy Vilmos10-May-09 21:47
professionalNagy Vilmos10-May-09 21:47 
AnswerRe: Java Event Handling Flow ??? Pin
Zealous_Me11-May-09 3:47
Zealous_Me11-May-09 3:47 
Questionneed help Pin
ahmedbhatti9-May-09 13:42
ahmedbhatti9-May-09 13:42 
AnswerRe: need help Pin
Nagy Vilmos11-May-09 3:02
professionalNagy Vilmos11-May-09 3:02 
QuestionGetting an applet's components returns null Pin
rareseu9-May-09 4:36
rareseu9-May-09 4:36 
AnswerRe: Getting an applet's components returns null Pin
fly9049-May-09 5:04
fly9049-May-09 5:04 
GeneralRe: Getting an applet's components returns null Pin
rareseu9-May-09 5:47
rareseu9-May-09 5:47 
GeneralRe: Getting an applet's components returns null [modified] Pin
fly9049-May-09 6:06
fly9049-May-09 6:06 
GeneralRe: Getting an applet's components returns null Pin
rareseu9-May-09 6:13
rareseu9-May-09 6:13 
GeneralRe: Getting an applet's components returns null Pin
fly9049-May-09 6:23
fly9049-May-09 6:23 
GeneralRe: Getting an applet's components returns null Pin
rareseu9-May-09 7:01
rareseu9-May-09 7:01 
Questionword online editor in jsp [modified] Pin
qiuxumin18-May-09 21:48
qiuxumin18-May-09 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.