Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Swing question

  Asked By: Molly    Date: Jun 04    Category: Java    Views: 521
  

I have a JApplet with some controls and i would like to draw a
string of text on the applet when an event occurs.

Here is the pseudo for what i would like, but i dont know the
correct way to write this, the only time i have used graphics is
with awt when i call paint;

public void paint(Graphics g) {
g.drawString("ABC", 10, 40);
}

I can use

public void paint(java.awt.Graphics g) {
...
}

but this just draws a white box over all the swing controls.

Even so, i want to use drawString when a certain event happens. I am
new to swing. I hope this isnt as weird to do as JTable!

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Swing question Or get search suggestion and latest updates.




Tagged: