Hi guys!
I recently made a game. (really corny!)
But, I want to package it and give it to my friends
I know that I can create a jar of it and add the images to the folder, but what I would...
Type: Posts; User: MW130
Hi guys!
I recently made a game. (really corny!)
But, I want to package it and give it to my friends
I know that I can create a jar of it and add the images to the folder, but what I would...
Never mind guys, I fixed it :D
Guess I'm the javamaster
The problem I am having is that I have a character peter griffin that runs into a burger, and when he does, he and the burger are supposed to reset to a random position. The game runs, other things...
Hi! Thanks for your reply
Unfortunately, that didn't solve it for me :(
Here is an example program:
import javax.swing.*;
import java.awt.*;
class SwingT extends JComponent {
public void...
Whenever I make something in Swing, I always need to resize the window for me to see the graphics on the window. I have been told to use the pack() method on it, which I have, but the problem with it...
I couldn't really figure out the easiest way to display an image. I tried the following way (in my code below), and it runs with no error but does not display the image. The image is called...
So, I have to extend JComponent?
I wrote a program to display a rectangle within a window, but it won't show. Is it because I didn't call the paint() method?
Sorry for indentation, I am using a text editor
import javax.swing.*;...
I can't figure it out could you fix it?
Ok, my new code is:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import javax.swing.Timer;
public class Square extends JFrame {
Ok. I know i'm not supposed to really explicitly ask, but do you think you could make my code work? I know you're one of the best on the site and could do it in an instance(no pun intended :P )....
Where should I define the setBackground and repaint methods?
Oh, ok. Does this only apply to the paint method though? For all others you have to explicitly call them in the main method? Thanks Norm, and i read a part
Hi Norm. I know what constructors are, and realize that doing new Carz() is just calling the constructor. What I don't get is how paint method is executed without being called. Thank you.
Hey guys! I had a question on two things. First, can you explain the parameters part of public void paint(Graphics g){} ? I don't understand graphics g? Is it an object? It doesn't have an instance...
ok here is the code..
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import javax.swing.Timer;
It still does not work I made it an action listener
I did and it still doesn't work.
Hey! I redid the code as you asked, and now I only get one error. Could you help me figure out how to fix this error? Below is the code.
import javax.swing.*;
import java.awt.*;
import...
Hello I am new to the forum and hope you can help me I put my code and then the errors I receive thank you so much
import javax.swing.*;
import java.awt.*;
import javax.swing.Timer;
public...