Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing the string

 
santhoshkumar samala
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to print the caharacter 's' at a given position on the screen using jsp.
I have all my pixel positions stored in data base(x coordinate,y coordinate)
how I can print the character 's' at given coordinates either in java or in html
please help me
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not that obvious, I think.
You may first divided your pages into several "boxes" (by Table). This table's cells are partitioned by the pre-defined cooridnates.
Thus, you can dynamically assign the character to that specific location at runtime.
But of course, this is not a good choice.
Another option is you consider to using JFC components, and print the character by providing the cooridnates of the components. But this is not a good choice as well, since it becomes thick client.
Thus, you may need to re-think it
Nick.
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create a class that extends JPanel.
Override the paintComponent method like so :

use like a normal JPanel.
D.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If by "screen" you mean the monitor, then JSP/HTML and related technologies will be no help to you. If you mean the browser window, then a simple CSS rule will do what you want.
Assuming that it is the latter for the moment, I'm sending this off to the HTML/Javascript forum.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that what you are talking about??
<div style="position:absolute;top:100;left:200">X</div>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic