These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:11 pm Advanced search

Canvas on Swing Components

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Canvas on Swing Components

Postby anjana.sasidhar » Wed Jan 12, 2011 3:31 am

HI,

I am new to HTML5. My application requires some graphics like rectangle, circle to be displayed on swing components like Jlabel or JFrame. I read about the <canvas> element which can draw rectangles and other shapes.But my question is can i draw these on JButtons or JLabels like the old html tags. If possible can you point me to the right place where i can read more of it.

Regards,
Anjana
anjana.sasidhar
<h6>
 
Posts: 2
Joined: Wed Jan 12, 2011 3:26 am

Postby Alan » Fri Jan 14, 2011 11:14 pm

I think you're either mixing up JavaScript and Java, or you're referring to a particular implementation of HTML (possibly just a subset).
Alan
<h5>
 
Posts: 18
Joined: Sun Oct 31, 2010 2:16 pm
Location: Cologne, Germany

Postby anjana.sasidhar » Mon Jan 17, 2011 6:57 am

I am refering to the <canvas> tag in HTML5, which uses java script to draw images. My question is can i do something like
JButton button = new JButton("<HTML><canvas>....</canvas></HTML>")
anjana.sasidhar
<h6>
 
Posts: 2
Joined: Wed Jan 12, 2011 3:26 am

Postby Alan » Mon Jan 17, 2011 11:03 am

That is a Java question.

I'm fairly certain Java Swing only supports a subset of HTML. It's doubtful any support for HTML5 elements exists at all.

You should probably look for a Java community to ask these questions in, though.
Alan
<h5>
 
Posts: 18
Joined: Sun Oct 31, 2010 2:16 pm
Location: Cologne, Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests