awt - Editable Java Drawing2D Texts and Images -
for gym exercise machine, need modify continuously texts , images inside jpanel.
drawimage()
, drawstring()
worked fine, 'dumb'. have repaint everytime.
the pseudo-code following:
public class cscreen extends jpanel { public cscreen() { repaint(); } public void paint(graphics g) { bufferedimage img=...some image...; int ximg= ...variable location...; int yimg= ...variable location...; g.drawimage(img,ximg,yimg,...); graphics2d g2 = (graphics2d) g; g2.setfont(...); g2.setcolor(...); string txt = ...some text...; int xtxt= ...variable location...; int ytxt= ...variable location...; g2.drawstring(txt,xtxt,ytxt,...); } }
is there way deal text , images, if objects, not pixels drawn?
please, help, appreciated.
Comments
Post a Comment