Results 1 to 7 of 7
Thread: Need some help...
- 04-19-2009, 11:54 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 4
- Rep Power
- 0
Need some help...
Hey I am new to computer science and have some questions about some java code.
what would be the best way to explain what these statements do?
1.)paper.drawLine(20,80,70,10);
paper.drawLine(70,10,120,80);
paper.drawLIne(20,80,120,80);
2.)private JButton myButton;
private int xLocation, yLocation;
3.)public void actionPerformed(ActionEvent event)
- 04-20-2009, 12:14 AM #2
If your new to computer science the best thing to learn first (if you want help) is that people aren't going to do your homework for you.
Also we need to have a good description of you want.
ie
What type of object is paper? Where is paper defined?
I'm assuming it's a Graphics object. If so the best way to figure out what the method does is either to look at the source code or look at the java api documentation. You should be able to navigate to the Graphics class and see it's DrawLine method.
2) Creates private variables which will not be accessible by other classes.
3) A method signature
Mr. BeansLast edited by Mr.Beans; 04-20-2009 at 03:25 AM.
-
First off, why not tell us what you think they may do? Then we'll probably have a better idea of how to help you. Best of luck.
- 04-20-2009, 12:18 AM #4
Member
- Join Date
- Apr 2009
- Posts
- 4
- Rep Power
- 0
Great! Thank you. That website is great. I am going over some questions from my book and am lost when it comes to some of the harder questions. Like this one...
Write a method for a program displays three JButtons named button1, button2 and button3. Write the actionPerformed method so that it adds 1, 2 or 3 to an integer instance variable named myScore depending upon which button is clicked.Last edited by cupojavanoob; 04-20-2009 at 12:21 AM.
- 04-20-2009, 01:56 AM #5
Member
- Join Date
- Apr 2009
- Posts
- 4
- Rep Power
- 0
Can anyone help me with this one?
Write a method for a program displays three JButtons named button1, button2 and button3. Write the actionPerformed method so that it adds 1, 2 or 3 to an integer instance variable named myScore depending upon which button is clicked.
-
Again, please show what you've done and what specifically you have problems with. Best of luck.
- 04-20-2009, 03:31 AM #7
Do you know how to display a JButton?
Check out How to Use Buttons etc..
It's a pretty good tutorial. Try your best and post any questions you have. We will be glad to answer them.
Mr. Beans


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks