Questions tagged [java-canvas]

A Canvas component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.

A Canvas component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.

118 questions
0
votes
1 answer

Resize a gwt canvas visible field, but not its content?

I have a website where I want to integrate a GWT canvas in the main layer. When I resize the browser window, I want the canvas "visible area" to resize accordingly, BUT not it's content. Somehow like in google maps where I just can see portions of…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

How to add a canvas in gwt ui-binder?

I have a basic ui-binder layout file, and want to place a canvas into the main content area. But using the following gives an error: No class matching "canvas" in urn:import:com.google.gwt.canvas.client: What is wrong…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

Change image appearance based on user actions?

I used applyTo(image) on a AbstractImagePrototype in the past. But now resources are mainly created with a @Resource AbstractImagePrototype…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
2 answers

Create editable lable/text?

I want to add text to a rectangle drawn. canvas.fillRect(...) But I would like the user to enter custom text for this rectangle. But how can I create an editable label in gwt canvas that can take user input? I want to achieve this in gwt canvas…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

How to extend the Context2d of a canvas?

I want to extend Context2d in order to create a specific method that can be invoked by context.myMethod(); Using this class: class MyContext extends Context2d { public myMethod(); } BUT I'm creating the canvas by Canvas canvas =…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

How can I create these kind of images in gwt?

http://yuml.me/diagram/scruffy/class/samples I know how to draw a rectangle like this: context.fillRect(x, y, width, height); How can those kind of images (not straight border, gradient, shadow) be created with gwt canvas? Is this possible at…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

Should I use Canvas or GWTCanvas?

I'm creating a canvas with GWT, and I have seen both solutions using Canvas.createIfSupported(); or new GWTCanvas(); Which one is the preferred, and why?
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
2 answers

GWTCanvas or gwt-graphics for interactive drawing?

I want to develop an app where the user should be able to draw objects (circles/elipses), connect them via lines/arrows and drag/drop them, add text to them etc. Of course I also have to write eventHandling. What is most suitable for that? Would you…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
3 answers

JPanel placed Behind JScrollPanel

I have this code, where Canvas is a class I made that extends JPanel it holds an image. But when I use it, it places the canvas not on top of the JScrollPane, but behind it. Why is it doing that? Here is how the ScrollPanel is…
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
0
votes
2 answers

Add image to a java awt Canvas background

I am trying to add a background image to java awt canvas but still couldn't make it through. can any body have the solutions for this or any piece of code for this problem. the code is given below, thanks. import java.awt.*; import…
Thusira Dissanayake
  • 153
  • 1
  • 4
  • 15
-1
votes
1 answer

Java AWT canvas in the output is overiding it's own graphic contents

I was practising and came across a problem with no perfect explanation of solution. ''' package com.company; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import…
shubham shaw
  • 113
  • 12
-1
votes
1 answer

Can you make a Canvas scroll to the left

So I'm making a basic 2D game, and I'm using paths to move the player to a certain point. I am restricted to a window size of 800 x 600, and I want the path to finish at the X coordinate of 1400. How would I make the canvas scroll along to the left…
Alex
  • 878
  • 3
  • 16
  • 34
-1
votes
1 answer

draw a movable canvas on Jpanel

i want to draw a canvas that will be movable on a Jpanel. That is when the user clicks on the canvas and drags it it must move to a new positon. i have implemented the MouseMotionListener but i have no idea of what to include inside to make the…
Twekz
  • 35
  • 2
  • 8
1 2 3 4 5 6 7
8