I am using the ACM library to do a project for school. The project is to code the old game Breakout. I want to be able to start with a graphics window that's 400x600 pixels. I know that the GraphicsProgram class has a getWidth() and getHeight(), but I can't find a setWidth() or setHeight().
Thanks in advance!!
Robert
How to size a graphics window using the ACM library?
Started by Blue Indian, May 31 2010 06:17 PM
6 replies to this topic
#1
Posted 31 May 2010 - 06:17 PM
|
|
|
#3
Posted 01 June 2010 - 01:59 PM
Yes, I mean the Association of Computing Machinery. I am sorry for not clarifying earlier.
#5
Posted 01 June 2010 - 04:50 PM
Ok, thanks for looking for me. I will check out the swing library. Thanks again!!
Robert
Robert
#6
Posted 01 June 2010 - 04:56 PM
Can you please direct me to a good web page where I can learn about resizing graphics windows?
Thanks in advance!!!!!!!
Robert
Thanks in advance!!!!!!!
Robert
#7
Posted 02 June 2010 - 01:59 AM
Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials) here you can find a swing tutorial.
about resizing there is a component in the swing called JFrame that creates the window, the class that you want to be GUI for you application can extend the JFrame class and you can call set size in your class constructor and pass the desired size.
about resizing there is a component in the swing called JFrame that creates the window, the class that you want to be GUI for you application can extend the JFrame class and you can call set size in your class constructor and pass the desired size.
public class GUI extends JFrame
{
int width=500,height=500;
public GUI()
{
super();
setSize(width,height);
}
}
"Recursion is just a line of code"
-Karim Hosny-
My flickr
-Karim Hosny-
My flickr


Sign In
Create Account


Back to top









