Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 6th, 2005, 6:52 AM   #1
rross46
Newbie
 
Join Date: Nov 2005
Posts: 4
Rep Power: 0 rross46 is on a distinguished road
Simple, yet annoying problem with Java Beans

Hi.

I am trying to make a button bean, well a set of them having arrows facing in directions (n,s,e,w). I am having great difficulty drawing the triangles which will represent the direction.

I understand you use drawPolygon(i think) to do this but...

In the help features of Net Beans 4.1, it says drawPolygon(int[],int[],int[]);
When i go to try put this in, it totally does not like it.

public LeftButtonBean() {
        super();
        setPreferredSize(new Dimension (50,50));
        setBorder(null);
        buttonColour=Color.black;
    }
    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        g.setColor(buttonColour);
        g.drawPolygon();
        
      
    }

right i have that so far, i have left paramaters out of the draw polygon, which gives me "error, cannot find symbol method drawPolygon()".

Right does anyone know how i should go about this, the help just confuses me with its representations of what the parameters needed are.

Before anyone asks, i am a novice in Java programming. Please don't ask "why are you using java?" lol.

Thanks in advance guys.
rross46 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC