Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 drawing on panels
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
da_jugganaut




PostPosted: Tue Apr 19, 2005 10:54 pm   Post subject: drawing on panels

hi, im making a program for compsci class. it involves clicking various radio buttons on one panel to change the shape which is drawn on a different panel.

the structure of my code is like this :
code:

public class RadioShapes extends JFrame
{
public RadioShapes(){}
public void paintComponent(){}
class RadioButtonListener implements actionListener
{
public void actionPerformed(ActionEvent e){}
}
}

the class RadioButtonListener waits for the user to click on a specific button. the actionPerformed method recognizes that and assigns an int value of 1, 2 or 3 to a variable. the paintComponent reads this variable then draws the shape on the panel for the shapes.

the problem i have here is - in paintComponent, how do i specify which panel to draw to? my program compiles and executes, but the shapes do not appear. the listeners are working just fine. any ideas?
[/code]
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: