Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (198)
games submitted by our members
Games in WIP (758)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Play & Game Design / ActionListeners for an array of JComboBoxes... on: 2005-04-22 19:50:15

In my program, each user has a JComboBox. However, the number of users varies depending on how many users are specified at the start of the game.

As a result I decided to make an array of JComboBoxes:
private JComboBox[] characterBox;

Then, later I specify the size of the JComboBox:
characterBox=new JComboBox[size];

I have no problem creating the JComboBoxes or adding them to the JPanel.

The problem occurs when I try to make actionlisteners. The following code is in a for loop that runs the number of users in the game.

  • .addActionListener(
                        new ActionListener()
                                 public void actionPerformed( ActionEvent event )
                                         String picNum = (String)characterBox
  • .getSelectedItem();
                         );//END Listener

    The problem is that the compiler tells me x must be final. However I can't have it final because I am looping the creating of the Listeners. I know the actionlistener code works but I can't figure out how to create all of the listeners in a for loop. Any thoughts? Thanks.
2  Game Development / Newbie & Debugging Questions / Re: JScrollPane Question... on: 2005-04-18 12:41:02
Is there a way to directly control a JScrollPane? So if you want the pane to automatically show the bottom right is there a way to set the scroll to 80%x and 80%y?
3  Game Development / Newbie & Debugging Questions / Re: JScrollPane Question... on: 2005-04-13 12:11:41
Thanks for the tip. That is actually what I am trying to do, but the problem is that i can't figure out how to implement it. I know hod to do set up listeners for the keyboard, but I can't fiugre out how to manipulate the scrollbar positions.
4  Game Development / Newbie & Debugging Questions / JScrollPane Question... on: 2005-04-12 16:06:45
Is there a way to use the Keyboard to scroll a JScrollPane? I can't figure out what the JScrollPane scroll methods are so that I can re-define them.

Thanks for any help.
5  Game Development / Newbie & Debugging Questions / Re: Background Image question... on: 2005-03-21 12:13:36
I figured it out...

I was trying to add the MenuBar and was also setting it. Getting rid of the 'add' fixed the problem.
6  Game Development / Newbie & Debugging Questions / Re: Background Image question... on: 2005-03-20 17:34:51
Hmmm... that is basically what I have too (although I have my MenuBar as an extended class.

Maybe I do have something extra.

Do you think having JPanels with a setbounds (a,b,c,d) would make a difference?

I'll try it...
7  Game Development / Newbie & Debugging Questions / Re: Background Image question... on: 2005-03-20 16:50:22
Thanks for the tip.

I actually have another question too...

Is it possible to have the JFrame be set as

while also having a JMenuBar with JMenu's?

I tried putting it on, but there is a wierd effect where a white box appears above teh JMenuBar?

Any ideas?
8  Game Development / Newbie & Debugging Questions / Background Image question... on: 2005-03-19 23:01:34

I am creating a program where I need a background image to be scrolled.

I have a class that extends JFrame and in that class, I have several JPanels.

For one of the JPanels, I want a background picture. However, the JPanel will be a smaller size than the picture and I want the user to be able to scroll over to the right or left and view the rest of the image.

Also, I am not doing any animation in this program.

Any suggestions would be greatly appreciated.
9  Game Development / Newbie & Debugging Questions / JFrames and Resolution... on: 2005-03-02 15:37:02
Hi. I am creating a basic board game with JFrames and I have a few questions...

First, I want to set the resolution to 800x600 which I did with a setsize(800, 600). However, if I drag the window, everything gets messed up. Is there a way to solve this?

Also, I thought that one way to solve it might be to change the monitor resolution in the game. Does Java have a easy way of doing this? Thanks!
10  Java Game APIs & Engines / Java 2D / Project Design... on: 2005-02-17 15:13:04
I have decided to create a Monopoly type game in JAVA. I am thinking of using JAVA just because the graphics are easy to implement. My questions are for graphics:

Are JFrames the way to go?
If so, is there a way to get fullscreen resolution?
Would you suggest Animation?

Thanks for any suggestions.
Pages: [1]
roseslayer (439 views)
2016-08-06 11:43:29

roseslayer (399 views)
2016-08-06 09:43:11

xTheGamerCodes (475 views)
2016-08-04 15:40:59

xTheGamerCodes (468 views)
2016-08-04 15:40:24

orrenravid (818 views)
2016-07-16 03:57:23

theagentd (894 views)
2016-07-11 14:28:54

Hydroque (990 views)
2016-07-06 05:56:57

Hydroque (1001 views)
2016-07-03 08:52:54

GrandCastle (814 views)
2016-07-01 09:13:47

GrandCastle (640 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!