Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-09-2008, 03:11 PM
Zebra's Avatar
Member
 
Join Date: Apr 2008
Posts: 37
Zebra is on a distinguished road
How do I make a triangle?
Hey I am really new to applets, we are making them in class and we are suppose to create a house in the night with blinking stars. I know how to do everything, but make a triangle for my roof. I know how to make a triangle in regular java, but not one for an applet.

So how do you you make an triangle in an applet?
__________________
I am a Java n00b.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-09-2008, 03:15 PM
Zosden's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 218
Zosden is on a distinguished road
I think there is one in the java 2d package
__________________
Definition of Impossible = making a good game in Java.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-09-2008, 03:18 PM
Zebra's Avatar
Member
 
Join Date: Apr 2008
Posts: 37
Zebra is on a distinguished road
Quote:
Originally Posted by Zosden View Post
I think there is one in the java 2d package
Sorry, but what is that/ and where can I find it.

Is there just a code on how to make one?

like here is how to make a rectangle in a Java Applet:
Code:
setBackground(Color.black); page.fillRect(0, 175, 300, 50);
__________________
I am a Java n00b.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-09-2008, 04:09 PM
Member
 
Join Date: May 2008
Posts: 4
damounh is on a distinguished road
why dont you create two classes, one will be the applet, the other will be JPanel, and in the applet create an instance of the JPanel class and add it to the applet. then in the JPanel use the paint functions to draw just like drawing normally in java.

Damoun.H.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pascal Triangle help Magic101 New To Java 4 05-01-2008 08:51 PM
Computing the area of a triangle using Heron's Formula Java Tip java.lang 0 04-12-2008 09:39 PM
change the square to triangle java anotsu New To Java 2 02-06-2008 08:21 PM
Making triangle banie New To Java 4 02-02-2008 12:23 PM
Triangle jkswebsite New To Java 6 01-14-2008 04:33 AM


All times are GMT +3. The time now is 10:58 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org