[nbusers] Re: Java 2D display problems

  • From: David Johnson < >
  • To:
  • Subject: [nbusers] Re: Java 2D display problems
  • Date: Fri, 31 Aug 2012 15:47:43 -0400

On Fri, 2012-08-31 at 09:25 -0400, slboyls wrote:
> I am having problems displaying Java 2D graphics. I have created a JFrame 
> with JInternalFrames windows. I have placed a JPanel on the JInternalFrame. 

When you added the JInternalFrame to the jDesktopPane did you activate
it (yourjDesktopPane.getDesktopManager().activateFrame(internalFrame);).

> I have graphics code in the JPanel paintComponents method. 

Did you override the paint() method in your canvas?

  public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    // do whatever it is you do to generate your graphics
  }


> When I launch the JInternalFrame I have System.out.println statements 
> inside the paintComponents method telling me that I'm drawing on the JPanel 
> but no graphics show up.
> 
> I've read most things I have found to read but nothing particular to my 
> problem. I am using the Netbeans GUI builder for my display. There doesn't 
> seem to be any good examples of what I want to do.  
> 
> Any help is appreciated.




[nbusers] Java 2D display problems

slboyls 08/31/2012

[nbusers] Re: Java 2D display problems

David Johnson 08/31/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close