The Artima Developer Community
Sponsored Link

Java Answers Forum
Which is the best component to make 2D games?

1 reply on 1 page. Most recent reply: Apr 11, 2006 4:34 AM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sanjay Perera

Posts: 42
Nickname: angel6
Registered: Apr, 2004

Which is the best component to make 2D games? Posted: Apr 5, 2006 8:11 PM
Reply to this message Reply
Advertisement
1. Which is the best component to make 2D games? Is it Canvas?

2. Is there any component in the swing library which I can use instead of the CANVAS?

2. I have a problem, I have JFrame and a CANVAS is added to the CENTER. When I click on Menu, menu items are drawn under the canvas and I cannot see anything. I need a solution please.


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Which is the best component to make 2D games? Posted: Apr 11, 2006 4:34 AM
Reply to this message Reply
> 1. Which is the best component to make 2D games? Is it
> Canvas?
>
Canvas sounds about right.

> 2. Is there any component in the swing library which I can
> use instead of the CANVAS?

Not that I can thing of but you may use canvas in
conjunction with Swing components:

   //  within a JFrame or dialog
   //  set up your canvas as follows
   //  Canvas canv = new Canvas(someConfiguration)
   //  someConfiguration may be deduced via
   //  GraphicsEnvironment.getLocalGraphicsEnvironment()
   //           .getDefaultScreenDevice()
   //     		.getBestConfiguration(template);
   //  add your canvas to your JDialog or JFrame
   getContentPane().add(canv);

> 2. I have a problem, I have JFrame and a CANVAS is added
> to the CENTER. When I click on Menu, menu items are drawn
> under the canvas and I cannot see anything. I need a
> solution please.

probably to do with paint issues (i.e. you may have to
introduce a focusListener and make sure you paint your
components depending on focus being gained and lost from
your menuItems).

If I'm misleading or have misunderstood your Q's, my apologies...

Good luck

Flat View: This topic has 1 reply on 1 page
Topic: opaque Previous Topic   Next Topic Topic: boolean

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use