Please Help with JtextArea!! Need advice from Java expert!

Hi, I need something VERY simple, and it is unbelievable I'm looking for a solution for so long! I really hope some of you java-gurus can help me out. Here's the thing:
1. Make a Jframe
2. Add a JTextArea and use a transparent color (e.g. 0.1f,0.1f,0.1f,0.1f)
3. loop a setText method to display a constantly varying text, e.g. the time in milliseconds
I simply can't do it in any way if I use transparency. Without transparency it works with no problems.
I am on Mac, and I have checked out this site:
http://www.curious-creature.org/2007/04/10/translucent-swing-windows-on-mac-os-x/
but I can't figure out how the guy who wrote the code made it work on mac (he didn't add the full code and the imports). I already tried to contact him, but no answer...
so PLEEEEASE take 5 minutes to write a very small example of how to manage a varying text on a transparent window.
Thanks a lot in advance
Lele

-> did you maybe check out the link I posted?
Yes, I did which is why I asked the question are you trying to create a transparent JFrame so that the desktop image is displayed in the frame? To my knowledge this feature (if it works) is a Mac only feature and does not work on windows. If this is what you are trying to do then I have no idea how to do it and will not respond any more.
-> the GPS coordinates are displayed on top of the moving map, with no visible background
I guess I have trouble understanding what this is - "a map with no background"?
Is the map just not an image (ie. a JLabel with an ImageIcon) placed in a scrollpane? Then as the map moves you change the viewport position so it looks like the map is moving? Then you can simply add a label containing the GPS coordinates on top of the label representing the map.
-> have you considered using a JLabel in an OverlayLayout?
Right which is what I was thinking. Something simple like:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class LabelMap extends JFrame
     public LabelMap()
          JLabel map = new JLabel(new ImageIcon("yourMap.jpg"));
          getContentPane().add(new JScrollPane(map));
          JLabel point = new JLabel();
          point.setLocation(50, 50);
          point.setText(point.getLocation().toString());
          Dimension d = point.getPreferredSize();
          point.setSize(d.width, d.height);
          point.setFocusable(true);
          map.add(point);
          KeyListener kl = new KeyAdapter()
               public void keyPressed(KeyEvent e)
                    JLabel point = (JLabel)e.getSource();
                    Point p = point.getLocation();
                    if (e.getKeyCode() == KeyEvent.VK_UP)
                         p.y -= 5;
                    else if (e.getKeyCode() == KeyEvent.VK_DOWN)
                         p.y += 5;
                    else if (e.getKeyCode() == KeyEvent.VK_LEFT)
                         p.x -= 5;
                    else if (e.getKeyCode() == KeyEvent.VK_RIGHT)
                         p.x += 5;
                    point.setLocation(p);
                    point.setText(p.getLocation().toString());
                    Dimension d = point.getPreferredSize();
                    point.setSize(d.width, d.height);
          point.addKeyListener(kl);
     public static void main(String[] args)
          LabelMap frame = new LabelMap();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.setSize(300, 300);
          frame.setLocationRelativeTo( null );
          frame.setVisible(true);
}In the above example you can scroll the image and dynamically move the text using the arrow keys.

Similar Messages

  • I just exchanged a faulty iPhone 4 for a new one, when I got home to restore it, iCloud says "cannot restore backup". Can somebody please help provide much needed advice? Thanks in advance!

    I just exchanged a faulty iPhone 4 for a new one, when I got home to restore it, iCloud says "cannot restore backup". Can somebody please help provide much needed advice? Thanks in advance!

    Yep, that's the only message that popped out. Nothing else. Yes, it's running on the latest ios and I still can't restore it. I called apple and they told me it's probably something wrong with their servers. Anyway thanks for the advice.

  • Please Help with range of uncertainty in java program

    I really need help with this, I've been searching for an answer all day and have found nothing.
    This is the original program and I'm trying to make it so instead of stoppingDistance having to be equal to tailgateDistance for it to print minor wreck, it will allow a range of 40 feet. Like a range of uncertainty of plus or minus 20 feet, and I need to use a named constant that is: RANGE = 40.0
    import java.util.Scanner;
    public class StoppingA
    public static void main(String[] args)
    Scanner stdIn = new Scanner(System.in);
    double speed; // speed car is traveling;
    double tailgateDistance; // distance from other car;
    double stoppingDistance; // calculated distance
    System.out.print ("Enter your speed (in mph): ");
    speed = stdIn.nextDouble();
    System.out.print ("Enter your tailgate distance (in feet): ");
    tailgateDistance = stdIn.nextDouble();
    stoppingDistance=speed*(2.25+speed/21);
    if (stoppingDistance < tailgateDistance)
    System.out.println("No problem.");
    else if (stoppingDistance == tailgateDistance)
    System.out.println("Minor wreck.");
    else if (stoppingDistance > tailgateDistance)
    System.out.println("Major wreck!");
    } // end main
    } // end class StoppingA
    Edited by: Ensanvoration on Feb 23, 2010 3:31 PM

    Encephalopathic wrote:
    Ensanvoration wrote:
    Thanks, but I already tried that exact thing and it didn't work either. It's ridiculousIf you don't show us how you tried it, then we can only guess why it's not working.
    ... but if you wait around long enough, I bet you'll see JosAH post a recursive solution! :)Where is JosAH. Is he on vacation? Since I've been back, I haven't seen him.
    Well, let's raise a bottle of Grolsch to him anyway. More for us.
    ¦ {Þ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HELP!!! Need help with using DOS comds from Java

    I am trying to run ftp in DOS by using the following code, only its not working, when I run the program it opens the DOS window but nothing happens, it does run but returns me two the command prompt straight away. If anyone can help it would be great, thanks in advance.
    import java.io.*;
    class DosCmd{
    public static void main(String [] args){
    try{
    Runtime rt = Runtime.getRuntime();
    Process child = rt.exec("start ftp /c ftp 172.20.2.134");
    child.waitFor();
    catch(IOException io){}
    catch(InterruptedException e) {}

    I agree with ChuckBing,
    there is no option /c for ftp as far as I know (http://www.microsoft.com/windows2000/en/server/help/ftp.htm), why don't you try "start ftp 172.20.2.134"? What should this "/c" option do?
    Hope this helps,
    FReAK

  • Hi , please help with JTextArea.

    Hi, I have got to write an application that evaluates the factorials of the integers 1 to 5. Display the results in tabular format in a JTextArea that is displayed in a messa dialog.
    I have those codes:
    int n1 = 1, n2 = 2, n3 = 3, n4 = 4, n5 = 5, sum;
    JTextArea outputTextArea = new JTextArea();
    outputTextArea.setText( "The Factorials" );
    sum = n1 * n2 * n3 * n4 * n5;
    outputTextArea.append( sum );
    JOptionPane.showMessageDialog(null, outputTextArea,
    " The results are " );
    Now the compiler tells me that append doesn't take int type. Also if I cancel the append statement it works but it will not show me the numbers.
    Please any kind of help will be appriciated

    Thanks very much it worked.
    I realy appriciate the help you give me all the time.
    By Giuseppe, Italy, Tanks.anytime :),...BTW..one tip i would like to give is whenever u get a compile error saying that the method is not found,check with the java api ..

  • PLEASE HELP ME! NEED ADVICE NOW!

    OK. MY COMPUTER CRASHED. ITS DEAD. GONE. SO ALL MY iTUNES SONGS AND PURCHASED MUSIC ARE GONE, THEY ONLY EXIST ON MY iPOD. BuT! I NOW HAVE A LAPTOP WITH WHICH I AM NOW ABLE TO USE MY iTUNES ON. MY QUESTION IS:
    HOW CAN I KEEP ALL OF MY PURCHASED SONGS/VIDEOS???
    DO I HAVE TO START OVER? THIS WOULD BE MOST INCONVIENIENT. I WOULD LIKE TO FIGURE OUT A WAY TO KEEP ALL THE SONGS ON MY iPOD AND PUT THEM ON MY LAPTOP.
    PLEASE GIVE ANY ADVICE YOU HAVE ON THIS SUBJECT.
    THANK YOU VERY MUCH.
      Windows XP  

    PodUtil
    YamiPod
    Both will rip files from your iPod, and place them in a specified folder on your computer.

  • HT4199 I just got a new iPod touch 4th generation and I'm trying to connect to my router and my iPod says, 'Cannont find network.' I don't know what to do! No other networks come up on the list so I can't 'tag' along with thier wifi. Please help. I need a

    I just got a new iPod touch 4th generation and I'm trying to connect to my router and my iPod says, 'Cannont find network.' I don't know what to do! No other networks come up on the list so I can't 'tag' along with thier wifi. Please help. I need advice.

    What type network is yu router set up for? The 4G iPod can only connect and see 2.4 GHZ networl like B, G and the 2,4 GHz N. There is also a 5 GHz N but the iPod will not even seethat network.
    See:
    iOS: Troubleshooting Wi-Fi networks and connections
    iOS: Recommended settings for Wi-Fi routers and access points

  • HT5824 I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. Please help with turning my iMessage completely off..

    I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. I have no problem sending the text messages but I'm not receivng any from iPhones at all. It has been about a week now that I'm having this problem. I've already tried fixing it myself and I also went into the sprint store, they tried everything as well. My last option was to contact Apple directly. Please help with turning my iMessage completely off so that I can receive my texts.

    If you registered your iPhone with Apple using a support profile, try going to https://supportprofile.apple.com/MySupportProfile.do and unregistering it.  Also, try changing the password associated with the Apple ID that you were using for iMessage.

  • Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be ab

    Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be able to download the srtony adobe.

    Adobe - Lightroom : For Macintosh
    Hal

  • I built website with muse on trial and loaded to business catalyst site. I purchased Muse yesterday and trying to transfer the website from business catalyst to my own domain name hosted elsewhere. can anyone please help with instructions?

    I built a website on Adobe Muse trial and loaded it onto business catalyst site. I purchased Muse yesterday & trying to transfer the website over to my own domain that is hosted elsewhere. I cant find good on-line instructions. Can anyone please help? I need to get this sit live ASAP for promotion campaign.

    Hi
    You would need to delete the domain from existing site and then add to your BC site.
    Please refer here for more details :
    https://forums.adobe.com/message/6365328#6365328
    Thanks,
    Sanjit

  • Need some help with downloading PDF's from the net.

    need some help with downloading PDF's from the net.  Each time I try to click on a link from a website, if it takes me to a new screen to view a pdf, it just comes up as a blank black screen?  any suggestions?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • The enter key is not working in firefox but it has working fine in chrome and IE so please help me to rid out from this.

    The enter key is not working in firefox but it has working fine in chrome and IE so please help me to rid out from this.

    Hello gokulaan, '''try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Please Help! I need to delet "Fellow member" on Sk...

    Please Help!
    I need to delete a "Fellow member" on the Skype manager. I don't know what is "Skype manager" and why the user Greiman Gomez Garcia (scanman113)  is registered there, I DON'T KNOW HIM.
    I already have seen the screens on the FQA, but I never can get to those.
    I'm logging on web.
    Thank you very much for your answer.

    Hi, moremay, and welcome to the Community,
    Your report reads as if your account may have been compromised.  Can you still sign in to your account dashboard?  If yes, check that the account's registered e-mail address is accurate and valid.  Then, change your account's password - I prefer to do this from within the Skype software itself.  After this, you can contact Skype Customer Service to close the "Skype Manager" set-up.
    If you can not access your account, create a new account to use in order to contact Skype Customer Service and to recover your first account, as well as to disengage the "Skype Manager" which account hackers tend to use when they hack accounts.
    Here is a link to the instruction on how to contact Skype Customer Service via their secure portal: Contact Customer Service
    Skype is aware of lingering problems with the website when contacting their customer service agents. If you experience difficulty reaching Skype Customer Service or find yourself redirected back to the Community, please try again using a different web browser and choosing a different path through the various drop-down menu options presented. Also, look to approve a pop-up dialogue box which would connect you to start an instant message chat with a customer service agent. If you have pop-ups blocked in your browser settings, this will also block reaching an agent.
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Please help with slideshow problems!

    Am using Photoshop Elements 8 and trying to make a slideshow. Have tried 4 times now and keep ending up with same problem, cannot reopen project to continue edititing.  Won't show up in orginizer and when I find on harddrive and try to open get message " wmv file cannot be opened".  How can I save a
    slideshow inprogress and be able to reopen and continue to edit and make slideshow?  I want to thank anyone who can help me with this in advance as I
    have gotten so frustrated that I want to just scream.
    Thanks

    Thanks for the help, thought I had done so but maybe not.  Anyway will have another go at it, now may I ask another
    question?  I am trying to add audio to slideshow.  I have some music I purchased thru amazon as mp3 files but I get
    message no codec and when I try to add wmv I get same message.  What type of file do I need and how can I add
    multiple songs to one slideshow.   I have one little wmv file that will go in, but it just replicates itself multiple times until
    it fills slide show. 
    Thanks again, sorry to be a bother, but this thing is driving this old man crazy.
    Date: Sun, 26 Dec 2010 20:34:32 -0700
    From: [email protected]
    To: [email protected]
    Subject: Please help with slideshow problems!
    You need to save the slideshow project in order to be able to go back later and make changes or additions to an existing slideshow . The wmv file is a final output format.
    Now you are most probably using only the Output command: that is what makes the wmv file.
    You should also do the Save Project command. (and I make it a practice to do the Save Project command before I do the Output command).
    If you look at the Elements Organizer 8 Help, there is a topic on "Create a slide show".
    -- Very close to the beginning of that topic is a screen shot of the Sldie Show Editor screen,
    -- The bar below the usual menu bar is labeled with a "B" and called the Shortcuts bar.
    -- The 1st entry on that Shortcuts bar is "Save Project"
    It is the Save Project command that saves the information about which photos, audio, etc you placed in that specific slide show so that you can come back again to do subsequent editing.  Save each Project with a unique name.
    After completing the Save Project command, you shoud see an "icon" in the Organizer for that slide show.
    Note:  you must also keep the photo files and audio files which you have used in this slide show: you can't delete them because the project file does NOT contain a copy of the photos, it only has the identification and folder location of the photo and audio files.
    >

  • How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore. Please help with proper steps, if any.

    How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore.
    On the new computer, I am getting a message that my all purchases would be deleted if I sync it with new iTunes library.
    Please help with proper steps, if any.

    Also see... these 2 Links...
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141

Maybe you are looking for