Jump to content

  • Log In with Google      Sign In   
  • Create Account

[java] What can you do with Java2D?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 05 May 2000 - 11:39 PM

I haven''t seen many things that would encourage me to use it. Do you have any demos or anything good looking done with it? All I have seen can be done with AWT with little bit better experience. Also, my second question is, when making custom graphical buttons should I extend it from AWT''s button and then call custombutton cb; -- init(); -- cb=new custombutton(mypicture, width, height, and so on); or create new one from Canvas and then code all needed stuff for it? Time comes, time goes and I only am.

Sponsor:

#2 Jerry Lynn   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 May 2000 - 04:05 AM

When you installed your JDK there should have been a directory ''demo/jdc/j2d'' created as well. In that directory there is a file named ''Java2Demo.jar''. It pretty well hightlights J2D features. I think you will see that J2D offers several performance and feature advantages.

Of course, even on my relatively fast system performance wasn''t great. I don''t know if that''s just how the demo was written (it displays several features on each page) or if the performance of Java 2D was just being maxed out.

#3 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 May 2000 - 05:42 PM

try looking at the javadocs and see what java.awt.button extends (or implements) ... it''s something like abstractButton class. If you just want a picture for a button you might want to look at imageIcon class, that''s what they use in the tool bars, so it might work.

#4 Smoo   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 May 2000 - 03:51 AM

Well for creating graphical buttons I just used:
public class MapEdButtons extends Canvas
{
Image mapEdButton;

public void update(Graphics g)
{
paint(g);
}

public void paint(Graphics g)
{
g.drawImage(mapEdButton, 0, 0, this);
}

public void setImage(Image img)
{
mapEdButton = img;
}
}

and in the main class just called setImage and then the paint for this class. It worked for me.

Smoo

#5 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 07 May 2000 - 06:15 AM

quote:
Original post by Smoo

Well for creating graphical buttons I just used:
public class MapEdButtons extends Canvas
{
Image mapEdButton;

public void update(Graphics g)
{
paint(g);
}

public void paint(Graphics g)
{
g.drawImage(mapEdButton, 0, 0, this);
}

public void setImage(Image img)
{
mapEdButton = img;
}
}

and in the main class just called setImage and then the paint for this class. It worked for me.

Smoo


Yeah, I know, but is it faster than extending from normal button? It has serveral good things like ready made animation. I don''t want use swing, because A) It''s slow B) It doesn''t support gif''s natural transparency so I have to use slow swing features to do that because AWT way did not work.

Does anyone know where to get BMP file format extension/usage class?



Time comes, time goes and I only am.

#6 Hitman   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 May 2000 - 04:04 AM

If you want to see some neat things you can do with java, go to this site. Check out the raycast engine especially.

http://www.2nu.com/Wayne/index.html






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS