aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes how to display text on image which keeps on getting changed ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to display text on image which keeps on getting changed ?" Watch "how to display text on image which keeps on getting changed ?" New topic
Author

how to display text on image which keeps on getting changed ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

I have successfully manage to display a text on JLabel but when ever i m changing that text , the other text is displayed on the same image to try to rub the orignally writen text with
but that is not helping me , the originally written text is not going out so that other text which i m drawing appears clearly
my code, can any one has done it before ?



The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
super.paintComponent(g);
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Michael Dunn wrote:super.paintComponent(g);

still not getting the desire result
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you're calling displayTextOnImage() directly,
instead of calling panel.repaint(), which will call
displayTextOnImage()
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Michael Dunn wrote:you're calling displayTextOnImage() directly,
instead of calling panel.repaint(), which will call
displayTextOnImage()

done what you have said but still when i write Loading ... then after few second if I write Welcome then "welcome " appears over loading which makes every thing blur



Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this is what you had


this is how it should be
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Michael Dunn wrote:this is what you had


this is how it should be


what i did ...




still the out come is not desired , facing same problem , if you want to look at the entire working code please tell me , i will put here
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> still the out come is not desired , facing same problem ,

if it's still blurred, you must be calling displayTextOnImage() directly, elsewhere.

just to make sure we're talking about them same thing, run this, click 'next' a couple of times,
then check the 'clear' checkbox and click 'next' a few more times.
the text will get increasingly more blurred until the checkbox is checked, then will be clear,
until checkbox is unchecked.

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Michael Dunn wrote:> still the out come is not desired , facing same problem ,

if it's still blurred, you must be calling displayTextOnImage() directly, elsewhere.

just to make sure we're talking about them same thing, run this, click 'next' a couple of times,
then check the 'clear' checkbox and click 'next' a few more times.
the text will get increasingly more blurred until the checkbox is checked, then will be clear,
until checkbox is unchecked.


I guess this is where you are getting it all wrong or I have not get what you are saying
what you are doing is painting the surface of a panel
whereas
i m painting the image which is on label which in turn is on panel , so i guess instead of repaint image or panel we should repaint label with different image which contain different text...
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Michael Dunn wrote:> still the out come is not desired , facing same problem ,

if it's still blurred, you must be calling displayTextOnImage() directly, elsewhere.

just to make sure we're talking about them same thing, run this, click 'next' a couple of times,
then check the 'clear' checkbox and click 'next' a few more times.
the text will get increasingly more blurred until the checkbox is checked, then will be clear,
until checkbox is unchecked.


viola ! we have done it , I was correct instead of painting component we should repaint image and reload it in jlabel , if you have not putted this above code then i would never realize what you were thinking .....thanks buddy .....
we have done it .....:)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to display text on image which keeps on getting changed ?