I want to make a java text game, but also want picture representations of what's happening. How can i make it so that i have a console and an area for the current image above? Jframe?
Asked
Active
Viewed 91 times
-1
-
Yes, you can use JFrame. – FINDarkside Mar 22 '15 at 17:47
1 Answers
0
Here is some psuedocode that is the basic structure of what I think you want.
JFrame frame = new JFrame("My Game");
JPanel panel = new JPanel(new BorderLayout());
frame.setContent(panel);
JTextArea consoleArea = new JTextArea();
panel.add(new MyGameCanvas(), BorderLayout.CENTER);
panel.add(consoleArea, BorderLayout.SOUTH);

satnam
- 10,719
- 5
- 32
- 42
-
Thank you kindly, but it returns the message Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setContent(JPanel) is undefined for the type JFrame MyGameCanvas cannot be resolved to a type at Game.testmain.main(testmain.java:15) – user3395786 Mar 22 '15 at 19:07