JTextArea to look like JLabel

I did do some searching....go easy on me (first posting of a question)
I have a textarea on my frame I use like a status bar.....giving the user hints on what they can/should do based on the applications state. I'd like using the JTextArea because I don't have to concern myself with how long of a string I put in it.....in the worst case the user sees some scrollbars.
I would like to remove the etched look from the text area though. Is that possible? Basically I want a JTextArea that looks visually just like a JLabel. I've tried using JLabel, but when the text to be displayed is dynamic, it makes sizing the label next to impossible. The functionality of the JTextArea seems to work the best, if I can get that etched/raised look supressed.
thanks to all and many thanks to the plethra of info I've found in the forumns already!!!!
JJ

kirillg -
that's not what I'm looking for. All EmptyBorder
does is create space between the text in the area and
the etched border of the area. If you call
setBorder() and provide any border available from
BorderFactory, it applies that border around the text
in the area, but inside of the etched "outline" (I
hesitate to call it a border). I need the etched
outline to go away....Hmm, i beg to differ.
import java.awt.FlowLayout;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
public class RoTextField extends JFrame {
     public RoTextField() {
          this.setLayout(new FlowLayout());
          JTextArea textArea = new JTextArea("some text");
          textArea.setBorder(new EmptyBorder(0, 0, 0, 0));
          textArea.setColumns(20);
          textArea.append("\nSome string");
          this.add(textArea);
          this.setSize(300, 100);
          this.setLocationRelativeTo(null);
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     public static void main(String[] args) throws Exception {
          // UIManager.setLookAndFeel(new SubstanceLookAndFeel());
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    new RoTextField().setVisible(true);
}This produces text area without border.

Similar Messages

  • Looks like instantiation of interfaces; what is it?

    Some of the code examples I see look like instantiation of interfaces. But this is not possible. I would like to know what is happening here 'under the hood' and would appreciate it if anyone can shed some light on this.
                jchkBold.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    setNewFont();
            });This looks like an attempt to instantiate an anonymous ActionListener.
    In the following example, which works fine, it appears that AudioClip has been instantiated.
    import java.net.URL;
    import java.applet.Applet;
    import java.applet.AudioClip;
    import javax.swing.JLabel;
    import javax.swing.JApplet;
    import javax.swing.ImageIcon;
    public class DisplayImagePlayAudio extends JApplet {
        private AudioClip audioClip;
        URL urlImage = this.getClass().getResource("./images/denmark.gif");
        URL urlAudio = this.getClass().getResource("./audio/denmark.mid");
        public DisplayImagePlayAudio() {      
        @Override
        public void init() {
            this.add(new JLabel(new ImageIcon(urlImage)));
            audioClip = Applet.newAudioClip(urlAudio);
            audioClip.play();
        @Override
        public void start() {
            if (audioClip != null) {
                audioClip.play();
        @Override
        public void stop() {
            if (audioClip != null) {
                audioClip.stop();
    }

    Equitus wrote:
    Thank you jverd. You explanation is clear. I had guessed that some kind of implicit instantiation of another object must be underneath this construction. I speculated that it might be a copy of its outer class, with the new instance implementing the interface. You have called it object X. Is this an instance of Object? Every instance of every class is an instance of Object. But no, it's not just "plain ol' Object." It's a new class that's defined on the fly that is a direct subclass of Object (in the case of implementing an interface) or a direct subclass of whatever parent class you specified with new (in the case of extending a class).
    Thanks also warnerja. I guess from your answer that there is a new copy of Applet class instantiated. The line here:
    private AudioClip audioClip;seems to declare an object AudioClip.It declares a variable of type "reference to AudioClip."
    Presumably the declarations do not determine if the entity is to become a primitive, object or object that extends or implements something else until the next step,It can't be a primitive unless the type you declare is one of the primitives, none of which have subtypes. If you declare it as a reference type (class or interface), as is done here, then all that say is that it's a reference that will either be null or will point to an object that is a concrete instance of the indicated type or a subtype. That is it will be that class or a subclass, or a class that implements that interface.
    in which the declaration becomes an entity of some kind. Now you're just making up terms. It's just a variable, and the variable has a type. This is true for all variables. There's no "entity of some kind" voodoo.
    Am I correct to conclude that you can cast Applet as AudioClip?Er, no. Why would you think that?

  • Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Using multiple desktops with a 4 finger swipe on a Mac Book Pro running Lion- is there a way that I can allow Safari open on several but not all??  Looks like I can set it for one but not others.  All, one, or nothing

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • How do I make multiple movies look like one?

    I created a demo of 136 slides with mostly screencaps and one
    small flash animation. The final published flash file is
    approximately 30MB. When the demo is run on multiple computers, the
    CPU utilization rises up to almost 100%, this makes the demo run
    very slowly on most computers. I was advised to cut my captivate
    movie in half ( in slides)... however even then the CPU utilization
    is quite high. How can I break my demo into multiple linked movies
    (to bring down the file size) but still have it play smoothly
    without it stopping to load after each new movie? How do I make
    multiple movies look like one?
    Thank you.

    Would it work to make the navigation of the page go to the
    next movie?

  • I still need help. i am technically challanged.  i up graded my phonr to a 5 s.  i backed up my phone on icloud.  i cAn not get my notes or photos.   it looks like the icloud email address is wrong. how can i change it or get my missing items

    I need help. I am not good with technology. I upgraded phone today to 5 s I am missing notes and photos  it looks like the cloud address is not correct. Any suggestions

    Have you forgotten your password? - if so, you have a problem if the email address has gone dead.
    If you know your password, go to the iTunes Store, click on Account. log in and you can change the associated email address.
    If you don't know your password, and have no email address, you are going to have problems because it's difficult to see how Apple are going to identify you as the authorised owner of the account. Contact iTunes Support: go to http://www.apple.com/support/itunes/ - click on 'Other iTunes Store Features' in the list and then on 'Podcasts'. You will see a link to either 'Express Lane', which will guide you eventually to some contact options, or you may see a link to email them.

  • How do I get my Web Form - to look like - Paper Form

    I have several fairly complicated forms in PDF and WORD.
    I was hoping the acrobat form wizard could convert them and then i could import them to formcentral to be then embedded as html forms on website.
    Problem is:
    1. imported forms can not be converted into embedded html
    2. from reading help, i would have to re-design/author the form from scratch.
    Which I am willing to do:
    Provided:
    1. I can actually create a form that looks like the original online (or similar to)
    2. I can then print this as PDF (so that it looks exactly like the original pdf) or that it actually fills the original PDF fields from the original pdf document.
    IS THIS POSSIBLE?
    put another way..
    I want to have a form online that looks like the form on paper.
    the client can fill it out.
    submit
    it sends him a copy of the completed form
    it sends us a copy of the complted form
    if it needs to be changed, a staff member can edit it.
    what do I have to do to achieve this?
    THANK YOU VERY MUCH FOR HELP!!!

    For details of how to restore the menus see [https://support.mozilla.com/kb/menu+bar+is+missing]
    Once the menus are back, you can use the View menu, then select Toolbars and click on the names of the toolbars to toggle displaying them.

  • I downloaded Firefox 3.6 and now my tool bar is gone. No back arrows, forward arrows, file, edit, view, history, bookmark, tools....how do I get my web browser to look like a regular browser again?

    I downloaded the new Mozilla web browser and I had a Bing homepage setting. I changed back to yahoo but I ever since downloading I dont have any back arrows, forward arrows, file, edit, view, history, bookmark, tools, address bar....how do I get my web browser to look like a regular browser again?

    For details of how to restore the menus see [https://support.mozilla.com/kb/menu+bar+is+missing]
    Once the menus are back, you can use the View menu, then select Toolbars and click on the names of the toolbars to toggle displaying them.

  • I'm also having a music issue.  When my phone is attached to the computer (mac running 10.6.8) it looks like my music is there but its gray and I can't play anything.  I've tried to delete it and it won't let me but it does not show up on my phone.

    I'm also having a music issue.  When my phone is attached to the computer (mac running 10.6.8) it looks like my music is there but its gray and I can't play anything.  I've tried to delete it and it won't let me but it does not show up on my phone.

    By the way, I have tried shutting of the display switching in the power settings.  That was basically the only real answer I found anywhere.  It didn't work.

  • HT201210 i updated my 4s yesterday, but my phone will not work at all now, and will not turn off. It has a itunes image on the screen with an arrow undernieth and what looks like the charger lead. i've had it on charge! is there anything else i can do?

    i updated my 4s yesterday, but my phone will not work at all now, and will not turn off. It has a itunes image on the screen with an arrow underneath and what looks like the charger lead. i've had it on charge! is there anything else i can do?

    Cconnect it to your computer with the latest version of iTunes installed.

  • HT201077 After updating my iPhone4s to the lastest update my photostream stopped updated onto my comuter.  From my phone it looks like pictures have been moved into the photostream folder... but they are not showing up on my computer.  Help!

    After updating my iPhone4s to the lastest update my photostream stopped updated onto my comuter.  From my phone it looks like pictures have been moved into the photostream folder... but they are not showing up on my computer.  Help!
    I have signed out then back into the cloud.  I have comfirmed location of the photostream folder.  I have have even restored settings on my phone.  any ideas on what I can do to get it working again?  or do I have to accept defect, and manually save my photos?

    There's a whole lot to read in your post, and frankly I have not read it all.
    Having said that, this troubleshooting guide should help:
    http://support.apple.com/kb/TS1538
    In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it.

  • Some songs will not sync to my iPhone 4s, looks like they are loading but they never do.

    Recently I downloaded some new music and now when I try to sync to my iPhone 4S none of the songs i downloaded are syncing to my phone and even some of the songs that were on my phone are not anymore. On iTunes on "On this phone" or whatever the songs are there but it looks like they are loading even after the sync is over. I would really like some help cause this is really annoying... Thanks!

    Same here, I have a new iPhone 5S and it will not allow me to put any music on it unless I have purchased it from iTunes, even music that I own and have ripped from the CD will not upload to the phone. Really Bloody Annoying!
    Should have stayed with Android!

  • Sending email using mail that looks like a web page

    I want to send an email that looks like a web page (kind of like those emails from apple or other companies). I tried making a document in Pages, but then that didn't quite work. Of course, I could make the pages document into a pdf file, but that's not ideal. Any recommended application?

    Check Composing HTML messages in Apple Mail.

  • HT4527 I can't get all my music I purchased from Itunes on my iphone to work.  When displaying them on my computer I can't play them or on my phone.  They have a little icon to the left that looks like a repeat icon.  It won't let me play them.  Please he

    I can play the music on my itunes under my purchased section but when I go to my phone when I have it connected the a lot of the songs won't play on my song or from the itunes under my phone.  They have a little icon to the left of them that looks like a repeat icon.  It won't let me delete them from there nor play them.  When on my phone only it won't play them it just brings up the clip art but will not play.  Please can anyone help me.
    Thanks,

    Thank you - I thought that might be the case BUT why doesn't the music play that I have bought from itunes - do you happen to know please.
    All that happens is it just flicks through it all and won't play any of it???
    As in I select the song and it just flicks back one screen (if I am making sense).....
    I am really stuck and cannot work out what's gone wrong that's all.
    Considering a reset of my new iphone and trying again but done that once and it's still the same.

  • Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Something has happen my ipad air 2 it wont let me download or update any apps, when I press the button do update or download it looks like it is but it doesn't so if anyone knows what's going wind please help me

    Do you have any restrictions for purchasing apps on the phone? Settings > General > Restrictions. If you have a Mac computer or another Apple device can you purchase things in the App Store using the same Apple ID on something else?

  • I have downloaded updates for Firefox but my browser doesn't look like it should, no single menu button etc, how do I get it to look like your demo?

    The last few times I have been prompted to update my firefox for desktop, my browser has not looked any different even though I get notification to say updates completed successfully. When I update firefox gives a demo of new features and how my browser should look, mine has not looked like the demo for the past few updates. It's annoying because I really like the look of having just one menu button. How can I change the look of my browser?

    The Firefox button displays by default only in Windows Vista and Windows 7. You '''''can''''' have it display in Windows XP
    '''Menu Bar'''<br />
    *right-click empty space at the end of the Tab Bar, click "Menu Bar" to place a checkmark
    *Menu Bar checked = Menu Bar on; Firefox button off
    *Menu Bar un-checked = Menu Bar off; Firefox button on
    *Other methods of doing the same:
    **click Firefox button > Options, click Menu Bar
    **Quick toggle Menu Bar on/off: ALT+V+T+M
    To have the Menu Bar '''''temporarily''''' display when the Firefox button is on, press the ALT key or the F10 key to make the Menu Bar appear and use your mouse to make selections from the temporarily displayed Menu Bar. Why would you want to do this? The selections available are different.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

Maybe you are looking for

  • Can't get ipod to show up...

    I'm sure this sort of question has been posted before, but I have an annoying problem with my ipod. Long story short, I got a new computer and hooked my ipod up to it and everything. I downloaded itunes and even bought a couple songs, but I can't tra

  • Huge size of ARTMAS IDOC

    Hello gurus, We are facing an issue in trasmiting generic articles(MARA-ATTYP = 01) along with all its variants via outbound ARTMAS IDOC(Transaction BD10). Some of the articles have around 40-50 variants. When such generic articles are transmitted vi

  • Removed from Sale

    We've delivered two books to the iBooks Store with iTunes Producer. The first one went through just fine. The second one, however, has the status of "Removed from Sale." It's been that way since September and I can't get it to change. I've triple and

  • Crashing - copy and paste iTunes URL into hyperlink panel

    Is anyone else having InDesign crash when they copy and paste an iTunes URL into their hyperlink panel? I am! Very annoying since I'm making an app that has over 50 of them! Thanks.

  • On MacBook air, "/sbin/fsck - fy" gives an error  "Invalid sibling link"k

    MacBook air will not start on powen-on.  Tried Disk Utility, but it can't repair.  Tried "/sbin/fsck -fy"  It gives an error "Invalid sibling link (4, 35776)... and at the end given a Disk full error, and quits by saying that "the volume Macintosh HD