Drawing a colored cursor on a text area given coordinates

Hi all,
Does anybody know how to draw a telepointer ( ie. a small coloured arrow like the cursor) given point coordinates on a text area? Please help.

This may help... just set the transparency in the png or use a gif
Image cur = getImage(getDocumentBase(), "cursor.png");
Cursor myCursor = Toolkit.getDefaultToolkit().createCustomCursor(cur, new Point(0, 0), "name");
textarea.setCursor(myCursor);

Similar Messages

  • Different  font colors in the same text area.

    i need to have a text area where i can setText with different colors.
    eg red if an error message, rest to be black.
    the only way to set text color i know is using setforegound color which will do the only documents, but i need to set font color per string.
    how?

    JTextPane
    StyledDocument
    MutableAttributeSet
    db

  • Different color text in text area???????

    hi,
    i am working on applet in which i want to show different color text in text area????????
    could any one help me

    I'm not sure it replies, we have developed an
    editorkit for the JEditorPane for colorizing a
    text with a property file describing a grammar. We
    provide in the packaging a trivial sample
    for coloring a java syntax in an applet.
    http://www.japisoft.com/syntaxcolor
    And of course it also requires that you buy it, and a.brillant forgot to mention that a.brillant has a financial interest in this product.

  • How to determine the position of cursor in Text Area?

    I have to solve next problem.
    I need to create special editor for my application.
    Page consist of two regions. First one is Text Area. Second one is Toolbar.
    User input Text in Text Area. He can use toolbar for inputing additional text in the cursor position.
    It should look like in this forum. When I press on "B", tag <b> inserts in my text, in the cursor position.
    Regards, Kostya

    If the functionality you need is already implemented in this forum software, just pick it up from there!
    Look at the HTML Source of the Post Message page and you will see that the Bold, Italic and Underline buttons call a Javascript function called
    onclick="styleTag('b',document.postform.body);return false;All the Javascript functions are in http://forums.oracle.com/forums/utils.js
    Thanks

  • How to change linux text area background color?

    Hi,
    I like to know the method. just like in windows platform.

    Just like change the text area color in notepad.exe
    so i mean X11 and gnome.
    do you mean inside a terminal when you're running X
    No, i can change the color in gnome terminal.
    But i can not change the color in openldev(or any other gtk apps)
    I hate the default color(white),
    want text background color as grey, without configure each apps color.

  • How to change the color of the text in the Text Field or in the text area??

    HI all,
    i think its a very simple problem, still, can anyone tell me how i can change the color of the text and also its font, before i display it in either a textfield or a text area.
    bharath

    Just Use:
    JTextField.setForeground(Color.RED);
    so SIMPLE na!
    Balakumar .M
    http://i5bala.blogspot.com
    --

  • Text Area (Cursor)

    Is it possible to hide the blinking cursor in an input field?
    If yes please let me know the code

    Whoa Its resolved
    I unchecked the editable option of text area which doesnt allow the user to enter anything in the textarea until the audio is completed. This has resolved the issue of a cursor blinking when going to Slide 2 and coming back to Slide 3.
    Just need to resolve the usability issue part now
    I just need to hide the mouse cursor now till the audio is completed and then allow the user to type.

  • Color coded text area

    How can I make a text area that when you type, if it is a reserved word it change it's color, like JCreator or some editor

    Swing related questions should be posted in the Swing forum.
    How can I make a text area that when you type, if it is a reserved word it change it's colorYou can't. You need to use a JTextPane (or JEditorPane)
    Search the Swing forum using "syntax highlighting" as the keywords to find other postings on this topic. You may even find my "SyntaxDocument" solution which will work for Java but not other programming languages.

  • What controls the color of the cursor that selects text when you use the "Edit Document Text" tool?

    Hi, I have had a student ask me a question I cannot answer: what controls the color of the cursor that selects text when you use the "Edit Document Text" tool?
    I have only seen it appear as a black semicircle over each letter, but at a different computer in our training facility, this same tool appears as an aqua-green highlight.
    Is it a preference I never noticed? Thanks for any info.

    What version of Acrobat? What operating system?

  • [FL8] cambiar el color del scroll del componete text Area

    aupi gente
    pues eso,,estoy mirando la ayuda del flash y no doy con la
    solucion
    alguien, lo ha tenido que cambiar d ecolor alguna vez?
    saludos y gracias de ante mano

    Horgykitkat wrote:
    What I found after taking out the heights from the text areas is that I was left with uneven text column lengths (alternating beige areas). So I created a repeatable jpg with the same alternating beiges and put it as the background of the bodyArea tag. Again, if there is a better way, please let me know!
    A repeating background image to 'fake' equal height columns is perfectly ok.
    It won't work IF your page is responsive but it isn't so no problem. If it were responsive a better solution would be to take advantage of the css property display: table; and display: table-cell;
    In reference to your footer background color not showing I would assume you have floated items within the footer container. If so then you need to clear those floated items which allows the footer container to wrap itself around the floated items inside it.
    You would do this by using css - overflow: hidden; - on the parent container which has the floats inside it.

  • Drawing a special cursor: completely repaint everytime or only a region?

    Hello, I'm currently building an application which displays a BufferedImage. When I move the cursor in the the component that displays the BufferedImage my app draws a special cursor. It's a square which is moved only if my current position is dividable by 16 (if there was a grid, it would change it's position when the mouse moves to another square in the grid, it is around the square that the mouse occupies). At first, I was only using on thread so the application was a little laggy and my cursor thing didn't work too well. So I decided to use another thread to take care of my cursor. The drawing is in another class (external to the drawing class), therefore, I use getGraphics (since my drawing class subclasses JComponent). I signal a draw by changing a variable. I have to erase my old cursor to draw the new one. The problem is that my component "'flashes" gray instead of staying the way it should be (which is black, for now). Here are my questions: Why does it flash gray ? and what should I do to change that?
    Here's my code:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    class Cursor implements Runnable {
         public boolean draw;
         public int[] iCursorCoord;
         public JComponent drawSurface;
         private Thread t;
         private Rectangle cursor;
         Cursor(){
              cursor = new Rectangle(0,0,15,15);
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = 0;
              iCursorCoord[1] = 0;
              draw = false;
              drawSurface = null;
         Cursor(int[] initCoord){
              cursor = new Rectangle(initCoord[0],initCoord[1],15,15);
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = 0;
              iCursorCoord[1] = 0;
              draw = false;
              drawSurface = null;
         Cursor(Rectangle rect){
              cursor = rect;
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = rect.x;
              iCursorCoord[1] = rect.y;
              draw = false;
              drawSurface = null;
         Cursor(JComponent drawSurf){
              cursor = new Rectangle(0,0,15,15);
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = 0;
              iCursorCoord[1] = 0;
              draw = false;
              drawSurface = drawSurf;
         Cursor(JComponent drawSurf, Rectangle rect){
              cursor = rect;
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = rect.x;
              iCursorCoord[1] = rect.y;
              draw = false;
              drawSurface = drawSurf;
         Cursor(JComponent drawSurf, int[] initCoord){
              cursor = new Rectangle(initCoord[0], initCoord[1], 15, 15);
              t = new Thread(this);
              iCursorCoord = new int[2];
              iCursorCoord[0] = initCoord[0];
              iCursorCoord[1] = initCoord[1];
              draw = false;
              drawSurface = drawSurf;
         public void init(){
              t.start();
         public void run(){
              while(true){
                   if(!draw) continue;
                   draw = false;
                   cursor.x = iCursorCoord[0];
                   cursor.y = iCursorCoord[1];
                   System.out.println("Inside Cursor::run()");
                   Graphics2D gfx = (Graphics2D) drawSurface.getGraphics();
                   this.completePaint(gfx);
                   Color current = gfx.getColor();
                   gfx.setColor(new Color(84,255,3));
                   gfx.draw(cursor);
                   gfx.setColor(current);
         private void completePaint(Graphics2D gfx){
              int layer = MapMaker.getLayerMode();
              if(layer != 4){
                   BufferedImage bi = MapMaker.getCurrentMap().getData(MapMaker.getLayerMode());
                   gfx.setPaint(new TexturePaint(bi, new Rectangle(0,0,MapMaker.getCurrentMap().getWidth()*16, MapMaker.getCurrentMap().getHeight()*16)));
                   gfx.fillRect(0, 0, MapMaker.getCurrentMap().getWidth()*16, MapMaker.getCurrentMap().getHeight()*16);
                   //gfx.drawImage(bi, null, 0,0);     
              } else {//Will be implemented later, render will be modified
                   System.out.println("Will be implemented later");
    }P.S.: This is only part of my code. There are other classes that I do not post because I believe it is not necessary. I will post the full code if needed.

    You need to override the paint(Graphics g) method. E.g.:
    public class MyPanel extends JPanel {
         public void paint(Graphics g) {
                   super.paint(g);
                    // ... do draw code here
    }The reason your app is flashing is because your code only executes
    when the thread is requests it to. Inbetween the time your code is
    executing, other threads are calling the paint(Graphics g) method.
    Gray is the default color used in painting.
    You can use a thread to call the repaint() method, but no drawing
    should be done in the thread.

  • Cursor issue - strange text on screen

    Hi folks, very computer illiterate so please excuse. I have some lines of text attached to the cursor and to various areas of the screen - toolbar at top, dock at bottom of screen, all files on desktop. Have turned off computer, unplugged it and said abracadabra. Text still there like a bug that has attached itself. Text is in the form of a block made up of small chunks of 5 tiny vertical lines in 4 columns of 8 chunks. Any ideas how I can get rid of it?
    Carrie

    Welcome to Apple Discussions,
    Those symptoms could unfortunately indicate video hardware trouble. Take a look at this old thread in the iMac G5 forum (there are a number of similar threads there as well):
    [Small lines / dots over parts of screen|http://discussions.apple.com/thread.jspa?threadID=1874655]
    Is your display similar to the image link in the first post there? See the other posts in that thread as well.
    What kind of computer are you using? Other models can have similar video hardware issues, but iMac G5s are particularly susceptible to these, my own previous computer included.
    Your own problem still could be from a software issue, but I would run Apple Hardware Test - it should be on one of the the original install discs that came with your computer.

  • Texts are not showing up after upgrading to version 11

    Could someone help me with why some of my texts are not show up on my Flash project? Before the upgrade, everything is fine. However, after upgrading to version 11, my texts are disappearing.
    Before (version 10.3.183.7...)
    After (version 11.0.1.152...)
    The texts in the boxes will disappear, when I hover mouse cursor over it. Those boxes with texts in them are created with an external AS file, and the texts are dynamicaly changed/put in with an external XML file. There is a mask on the boxes, show only 4 at a time.
    Demo: www.ethanslin.com/portfolioWorks/flashWorks/demo/
    You will see the changes with Flash player version 11, and everything working fine with older versions.
    I use iMacs with Snow Leopard and Lion, and this happens on all of the browsers with Flash Player version 11.01.152. I also tested on Windows 7, and it is still happening. Is this a Flash Player bug or something changed that I am not aware of? Is there a work around for this?

    This is a known issue and we have a fix for this in our next release. Thanks for posting.

  • Report Title and Text Area issue when exported to pdf using Viewer

    Hi there,
    We are using OracleBI Discoverer Version 10.1.2.55.26
    We have reports that displays Report title containing the following
    - Report Title
    - Runt Date and Time
    - Page No
    And text area which displays 'Last Page'
    Following properties are set at the worksheet level using page setup
    Report Title --> 'Print on every Page'
    Text Area --> 'Print on last page'
    The report when exported to PDF using Discoverer plus works fine and displays report title and text area as defeined.
    But when we try to export the same report to pdf from Discoverer viewer, it displays
    - Report title on first page only.
    - text area on all pages
    All our users accesses report using discoverer viewer so we cannot open discoverer plus to them.
    Is there a solution which will enable us to export the report in pdf using discoverer viewer and displays the same output as discoverer plus.
    Please let me know... If you have any questions then please feel free to ask.
    Thanks in advance for your help...
    Manish

    but when opened on other os x machines some text is colored differently than it should be
    Well, if typographic objects are colour managed, the colour appearance is dependent on the source ICC profile that describes the colourants in the typographic objects and the destination ICC profile that describes the colours the display is able to form and the RBC colourant combinations that will form those colours.
    In general, typographic objects should have special treatment, since the expectation is not that typographic objects should be colour managed, but that typographic objects should simple be set to the maximum density of dark. On a display, that is R=0 G=0 B=0 and on a seperations device (a lithographic press) that is C=0 M=0 Y=0 K=100.
    If for some reason typographic objects are colour managed, and if the ICC profiles for the displays are off by half a mile or more in relation to the actual state of the display system, then the colours will not be the same. On the other hand, if those displays are calibrated and characterized, then the colourants will be converted to form the same colours on the displays.
    /hh

  • How to add a text area in a Content pane..?

    Hi,
    I created a content pane with 5 buttons. One of them is a quit button, and I was able to create an "system.exit(0)" event handling for him. My problem is.. I have 4 other buttons, and I want them to show some text when I click them. How do I add a text area bellow my content pane..?
    Copy/paste my code to see what im talking about :) :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Interface extends JFrame {
    public Interface() {
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    JButton button1 = new JButton("Test1");
    JButton button2 = new JButton("Test2");
    JButton button3 = new JButton("Test3");
    JButton button4 = new JButton("Test4");
    JButton button5 = new JButton("Quit");
    ButtonHandler handler = new ButtonHandler();
    button5.addActionListener( handler );
    contentPane.add(button1);
    contentPane.add(button2);
    contentPane.add(button3);
    contentPane.add(button4);
    contentPane.add(button5);
    contentPane.setBackground(Color.orange);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String args[]) {
    Interface window = new Interface();
    window.setLocation(250,350);
    window.setTitle("FlowLayout");
    window.pack();
    window.setTitle("Test");
    window.setVisible(true);
    public class ButtonHandler implements ActionListener {
    public void actionPerformed( ActionEvent e )
    System.exit(0);
    Thanks alot! :)

    By default the content pane of the JFrame uses a Border Layout. So you should:
    1) Create a JPanel
    2) Set the layout of the JPanel to FlowLayout
    3) add the buttons to the panel
    4) add the panel to the content pane
    5) add your text area to the content pane
    Read this section from the Swing tutorial on "Using Layout Managers":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

Maybe you are looking for

  • How can I change the apple id on my iPhone 4

    Please help - I am going insane!!!  I have an apple id on both my mac and icloud (and laptop), but a different one on my phone.  The phone won't allow me to change to the new one, and the old one won't let me access app store/icloud either as I have

  • Data usage scam?  Really upset customer seeking help!

    I have been a long time customer with Verizon. Our data usage has become unmanageable!. We have 5 iphones on our family share plan.  We began with 10 GB after upgrading one of our phones & being talked into the family share plan by the in-store sales

  • HT1725 Error (-54) There was a problem downloading...an unknown error occurred (-54)

    I ordered a movie. The downloads began and were taking so long, I decided to stop the Standard Def download and let the HD go on. After the HD finished the DL, I tried beginning the download of the other incompleted movie and got the message in this

  • Show a Field type Flag in a Table and edit it

    Hi, i'm a beginner in Web Dynpro and i tried to solve on my own reading previous mails but i didn't find the solution. In my view i have a table binded from a table returned from a function called in the COMPONENTCONTROLLER. The custom structure of t

  • Need InDesign CS4 Pr6N fonts

    I converted a Trial version of ID CS4 to a fully-licensed version. The documentation states that there are a set of fonts known as the "Pr6N fonts" (see bottom of page 4 of the ID ReadMe.pdf). For physical product versions and downloads from the Adob