File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes printing the string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "printing the string" Watch "printing the string" New topic

printing the string

santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

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

santhosh<br />SCJP,SCWCD
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
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

SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
create a class that extends JPanel.
Override the paintComponent method like so :

use like a normal JPanel.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63872

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.

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Is that what you are talking about??
<div style="position:absolute;top:100;left:200">X</div>
I agree. Here's the link:
subject: printing the string
jQuery in Action, 3rd edition