I still haven't gotten the toggling between the two methods to work this is turning my hair grey
Type: Posts; User: coley909
I still haven't gotten the toggling between the two methods to work this is turning my hair grey
this is where I am at now buttons working they call the methods and repaint. How do I setup button 3 to flip back and forth between my img file and my drawpicture method
import javax.swing.*;...
Sorry thats what I meant.
Yes it had to do with JApplets
I run my programs in eclipse and they run in java applets
Can't we never learned JPanels, not sure what the teacher would think of that....
where should my buttons go then?
Also it does not work when I remove the code for my button locations. It still displays the methods all the time, also when I change the background I can no...
does this make more sense? int A = 0 unless button 4 is pushed turning A into a 1 allowing the if statement to run
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import...
When I click button 4 it should print my method for drawpicture and drawImage but instead it just prints both methods all the time instead of only when the button is clicked.
1559
It doesn't do what I want it just constantly prints the methods now no matter what. The purpose of that code was because I wasn't sure what to put in there I was testing and playing to see if I...
like this I am only working with button 4 by the way?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
//Cole Williams
//Making smiles and...
right, so my action listener should have a value in it of some kind that tells paint what to print. When the action listener proves true it should print my picture when false it should do nothing,...
ok I am getting it, so something like if button 1 is pressed then do A and A corresponds with something in paint. like paint A which = the method. right?
it can't print in the actionperformed but...
what I mean by not finding them is as follows. When the code called by the button is contained inside the actionperformed it runs perfectly fine . Thats why button 1 works properly. If I call...
It does work I called the image under init without buttons it pulled in just fine. I ran text.setText("test"); under each button they all printer test to my text box. My buttons are not calling my...
It should be the right path, it doesn't print anything.
modified the code fixed mistakes, still not sure why its not pulling my drawnimage in :)
Wouldn't a script be more suitable?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;
//Cole Williams
//Making smiles and colors with buttons
public class williamsclab10 extends...
Will do on the highlight tags, are you saying I should have a,b,c,d for the actionperformed?
--- Update ---
OMG I see it now up top
--- Update ---
Corrected copy and paste issue, I was...
Hey guys been lurking for awhile, I am at wits end on this. I have been learning java for the past couple months been doing usual stuff like methods, loops, if and thens that kind of stuff. Well I...