HELP!!! JTextArea keeps resizing to the size of the frame i have it on!!!1

I have a Frame that has a panel with a JTextArea in it, but when the text area is displayed (regardless of what size i declare it ) it resizes itself to the size of the frame .. Anbody that can telkl me why it does this, thanks in advance ; )

okay, i'm back from lunch. maybe this will give you some ideas. i added borders so you could see the outline of the scroll pane as opposed to the top panel which i'm thinking should be called left panel since you have it to the west. it's not meant to represent the best design, only to demonstrate some thoughts.
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.event.*;
public class MyFrame extends javax.swing.JFrame {
   private JPanel panel;
   private JScrollPane scroll;
   private JTextArea area;
   /** Creates a new instance of MyFrame */
   public MyFrame() {
      init();
   private void init(){
      setTitle("My Frame");
      panel = new JPanel();
      panel.setBorder(BorderFactory.createTitledBorder("my panel"));
      area = new JTextArea();
      area.setLineWrap(true);
      area.setWrapStyleWord(true);
      area.setRows(15);
      scroll = new JScrollPane(area);
      scroll.setBorder(BorderFactory.createTitledBorder("my scroll"));
      panel.add(scroll);
      getContentPane().add(panel,BorderLayout.WEST);
      setSize(400, 400);
      setLocationRelativeTo(null);
      addWindowListener(new WindowAdapter(){
         public void windowClosing(WindowEvent we) {
            System.exit(0);
      String tmp = "here is some text to test an area";
      for(int i=0;i<50;i++)
         area.append(tmp);
   public static void main(String[] args) {
      new MyFrame().setVisible(true);
}

Similar Messages

  • Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.

    Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.
    Is there any way to re-number them in the order I have chosen so that they can then be sorted by number? The scans are all from pre-digital images that I wish to move to a photobook and I don't want to have to organise them twice!
    Thanks for any suggestions.

    I was a bit short, Chris, sorry. It is limited, what can be posted, when typing on an iPad.
    Now I am back on my Mac. I meant the following:  Batch Change the date for a large range of photos, that should have a date stepped in increments.
    Select all Photos at once and use the command "Photos > Batch Change".
    Then set the date for the first photo and select an increment, e.g. one minute.
    Now all photos will get a new date assigned, incremented by one minute, in the sequence you have selected. So you will be able to sort them by date.  This way it will be unnecessary to change the titles or filenames.

  • How can I open a new page (using "Pages") when I already have another page open?  It just keeps reverting to the page I have opened already and won't let me open another one?

    How can I open a new page (using "Pages") when I already have another page open?  It just keeps reverting to the page I have opened already and won't let me open another one?

    To make a new document, go to File > New From Template chooser and choose the type of document you wish to create.
    To add a new page to an existing document go to Insert > Sections > Blank.

  • HT1600 my apple television keeps stopping during the movie, i have a good internet connection but cant understand why?

    My apple tv  keeps stopping during the movie, I have a good internet connection but cant understand why?

    The first thing to check would be your internet download speed, you can do this atwww.speedtest.net.
    1080p HD movies require a recommended speed of 8 Mbps, 720p HD movies require a recommended speed of 6 Mbps, while SD movies require a recommended speed of 2.5 Mbps.

  • Help Menu Keeps coming to the front

    Is there a way to stop the Help Menu from always being the top window? When trying to find something in the Help Menu, it always stays on the top and I can not get to the windows behind it. Is this a preference somewhere?

    No, that seems to be the way it does it!
    What you can do is move the application window to the right of your screen and keep the Help window on the left.
    That way you can at least see both as well as switching from one to the other!

  • Help for WindowedApplication resizing with the transition from center to foursquare?

    Any idea to resolve the WindowedApplication window to resize with the transition from center to foursquare?
    thanks a lot!
    David

    Use the Tween class to transition the window's current width and height properties to their final width and height. Register a function to receive one of the tween's "motionChange" event so you can reposition the window accordingly when its w and h are changed. You'll need to measure the window's bounds and position at each step to make sure it's not outside the screen bounds, or smaller/larger than allowed. How you resize the interior stage content is up to you...

  • Help to keep me in the Palm Zone...

    Hello,
    I am been a satisfied user of my Palm Lifedrive for the past 5 or 6 years, actually I bought it two times, cause my first Lifedrive was stolen and I could not survive without it. I am an Interventional Cardiology MD and my current Lifedrive died with honors, I live in Venezuela - South America and I am really concern about where to buy a PALM PRE PLUS GSM unlocked, Will You have some information about where to go?.
    Best Regards,
    Gilberto Perez MD, FSCAI.

    Hello gilbert and welcome to the forums;
    The pre is not currently sold in a "GSM Unlocked" form such as previous devices were. However, the German QWERTZ Pre is unlocked, and other users have used it on other carriers.
    The problem you will encounter is with the app catalog. The app catalog is localized based on the country where you activate your profile. This means if you purchase a German Pre and activate it in Venezuela, you will not have access to any apps in the app catalog.
    Hope this helps,
    TreoAide

  • Keeping track of the books I have and books I want

    Does anyone have any suggestions for software to keep track of my old fashion books? I am a bibliophile and have a lot of books. I'd like to have a list of all my books with me on my iphone.
    Any suggestions?

    hmm, maybe you should suggest this to the guy who makes delicious library?
    www.deliciousmonster.com
    Message was edited by: Paul Lloyd Johnson

  • I have iphone 3gs 16 gb. after i downloaded software version 5.0, my phone stopped working. it keeps saying that the phone doesnt have a simcard.

    I got a message that " iphone software version 5.0 is available" for my iphone. After i updated it, i got a message that my iphone could not be activated and to try to connect to itunes which i did, but i got a message that my phone has no sim card. Even with a sim card inside, my phone says that there's "No service." What happened? Help!!!

    Yes, I tried. But nothing is working. I am feeling bad as such a costly phone stop working in 1.4 year ?
    I am just sharing my experience.
    I am not ranting but yes angry as I am eligible for upgrade in Nov 2012 so don't want to pay $149 for replacement as I can upgrade to iPhone 5.
    Apple expert please help me how can I fix it. It's completely software issue.

  • How do I stop text from resizing to the size of the browser window

    Hello there,
    I am using a DW CS3 template that has a sidebar div and a
    main content div - the text in the main content div keeps resizing
    to the size of the browser window - I don't want the text to resize
    if I make the browser window smaller - I want it to remain the
    same. I am trying to float the text right and input a width but
    this is not working for me. What am I doing wrong?
    HELP!
    Many thanks!

    >>What am I doing wrong?
    Not giving us a link to the uploaded page so we can see the
    page, how it
    behaves and the actual code.
    Until we see that you are unlikely to get a definitive
    answer. The problem
    is unlikely as you state it because text itself is never
    dependant on the
    browser viewport size.
    Walt
    "Fun Leprechaun" <[email protected]> wrote
    in message
    news:g9f7rq$ie4$[email protected]..
    > Hello there,
    >
    > I am using a DW CS3 template that has a sidebar div and
    a main content
    > div -
    > the text in the main content div keeps resizing to the
    size of the browser
    > window - I don't want the text to resize if I make the
    browser window
    > smaller -
    > I want it to remain the same. I am trying to float the
    text right and
    > input a
    > width but this is not working for me. What am I doing
    wrong?
    >
    > HELP!
    >
    > Many thanks!
    >

  • What exactly does a switch do with the frames it recieves?

    I've become ultra confused all of a sudden.
    Switch is a layer 2 device. So this means it deals with frames (builds and examines them). So when it receives a frame, it looks inside to see where the destination mac address is. But since the mac address is on some further away network, and not directly connected to the switch, how in the world can it decide which way to send it? The switch doesn't have a routing table so theres no way of determining. So it either sends it down a trunk link or out all the vlans associated with the source port. Now if its sending the frame out all the vlan ports then this certainly does not break up broadcast or collision domains. Switches have no idea of the topology of a network and therefor must be sending frames out every possible hole they can to get rid of it.
    But this would end up being huge problems. If I have a router on a stick topology, with trunk link. And a frame gets sent out all possible ports and a trunk link, the packet is going to get to the source, then after being routed through the router and come back it will be sent to the source again. Also isn't it making a storm if the router routes the packet back to the switch and the switch then sends the same packet down the trunk link, since everything gets sent to the trunk by default?
    Or not even with a trunk link. Just linked up to any router. If the mac address isn't directly connected to the switch it must send the packet out every port it can because it doesn't have any idea what else to do with. And if it sends it to the router, and the router says, no it has to go back towards you, wouldn't the packet just go in circles for years with the router saying, "its in your direction", and the switching saying "i don't know where this is supposed to go, so i'll send it anywhere i can"
    thanks for any help at all. really frustrated.

    Hi There
    In your topology example "Host A -> Switch1 -> Switch2 -> Switch3 -> Host B", for Host A to have any chance of communicating with Host B, they would have to be in the same VLAN/Subnet, as you have no layer 3 device to route between different VLAN's/Subnets.
    Therefore when Host A wants to send a frame to Host B it would check its own MAC address table to see if it has an entry for Host B. If it does, it will send the packet with the frame towards Host B. The source MAC addresses will be that of Host A and the destination MAC addresses will be that of Host B.
    If Host A does not have the MAC address of Host B it will send an ARP request out on to the wire to Sw1.
    Either way, as this is a single VLAN/Subnet, the way Sw1 and the other switches treat the frame will be exactly the same.
    Sw1 will receive the frame and check the source MAC address against its CAM table. If no entry exists, it will add the MAC of Host A plus the port to which Host A is connected to its CAM table. If an entry does exist, it will then examine the destination MAC address to see if it has an entry for it. If it has an entry it will forward (switch) the frame out through the interface through which Host B can be reached (This would be the uplink port to Sw2 in this case). If no entry exists, it will flood the frame out of all ports which are in the same VLAN as Host A, except the port the frame arrived on.
    SW2 will receive this frame and it will check its own CAM table. If it no entry exists for Host A's MAC address, an entry will be added. If an entry does exist, switch be will then check the destination MAC address.
    If it has an entry for Host B, it will forward (switch) the frame out of the port through which Host B can be reached. If no entry exists, it will flood the frame out of all ports which are assigned to the same VLAN as Host A. Sw3 will receive this frame.
    It will check its CAM table to see if it has an Entry for Host A. If not it will add one. If it has it will check the CAM table for an entry for the MAC address of Host B. If it has one, it will forward (switch) the frame out the port through which Host B can be reached. If no entry is found then Sw2 will Flood the Frame out of all ports which are assigned to the same VLAN as Host A.
    Once Host B responds to the initial frame,
    Host A will have the MAC of Host B
    Sw1 will know that to get to Host B it sends frames out through the port through which it connects to SW2. To get to Host A it sends the frames out through the port to which Host A is connected.
    Sw2 will know that to get to Host A it sends frames out through the port to which it connects to SW1. To get to Host B, it sends frames out through the port through which it connects to SW3.
    SW3 will know that to get to Host A, it sends frames out through the port through which it connects to SW2. To get to Host B it sends frames out through the port to which Host B is connected.
    At all times in this scenario, when Host A sends traffic to Host B, the Frame will have the source MAC of Host A and the destination MAC of Host B. Like wise when Host B sends data to Host A, the frames will have the source MAC of Host B and the destination MAC of Host A.
    What you want to understand is how a switch builds its MAC address (CAM) table.
    It checks the source MAC first, If an entry exists, then it checks the destination MAC. If no entry exists, then the switch creates and entry and then checks the destination MAC address. If an entry exists the frame will be switched to the relevant port. If no entry exists, then the frame is flooded out of all ports (in the same VLAN as the frame of the originating host) except the port the frame arrived on.
    Best Regards,
    Michael

  • How Do I Rotate Content, Not the Frame

    I am in InDesign CS1.
    I need to figure out how to affect the content of a placed image, not the surrounding frame. I know how to set the rotation angle of the selected object's frame:
    set rotation angle of selection to 10
    But for the life of me, I cannot understand how to leave the frame as it is and just rotate the content. I.E., normally, if I grab the direct selection tool and click an image (hovering over the image inside the frame turns to the hand tool), I can then manipulate the content without affecting the outside frame. But I want to do this with an AppleScript.
    I also assume that if someone can open this door for me, it will then lead the way to being able to scale the content, without affecting the frame. But I cannot figure out the secret of "content" vs. "selection". Halp!
    Thank you!

    Your definitions are what I would expect, but for me, applying each version as one of these two separate scripts:
    1)
    tell application "InDesign CS"
    activate
    set rotation angle of selection to 10
    end tell
    2)
    tell application "InDesign CS"
    activate
    set absolute rotation angle of selection to 10
    end tell
    Gives me the same result. The frame rotates and the content rotates with it.
    Let me start over with my problem as that may help...
    So let's say I have a frame and it has rotation 0˚. Inside the frame I have an object rotated to 5˚.
    Applying either of those two scripts has the same result. The frame rotates to 10˚ and the content (when selected with the direct selection tool) now shows a rotation of 15˚.
    But what I want is for the frame to stay at 0˚ and the content (when selected with the direct selection tool) to show a rotation of 15˚.
    I am thinking this may be relates to the "Transform Content" and "Transformations Are Totals" preference settings. Both of which I have turned on. I know how to turn them on and off with an AppleScript, but it doesn't seem to be helping.

  • Whenever i am using my laptop and my palms are on the base of the laptop and i am typing all of sudden... my screen size keeps resizing bigger or smaller

    i try to keep my thumb palms off the mouse pad when i am typing but every now and then my screen resizes larger or smaller until i take my left palm off the keyboard base its only when my left palm is resting on the base next to the touch pad. i type pretty fast so it gets annoying and yes it also jumps screens or reverts back to previous message and i have to choose ctrl z to undo and get back to my message i was typing... it also switches tabs on me as well... not sure why my palm being on the left of the keypad on the base should effect anything but it does after a while. and i have to stop what i am doing...and go to the firefox menu and change the screen size back down to 100% sometimes it goes up to 200-300 other times it goes down to 70-80% i find it annoying i i wish there was a way to turn off the screen resize in the setup panel. if its just left to be 100% i am happy with that... i don't need it to be bigger or smaller... there should be a way to LOCK it down... i understand that there are people out there with eye problems and needs to have the screen size increase using the + or - but there should be a lock so it just stays no matter what is happening on my keypad or touch pad or base of the pad... that screen size will not increase or decrease. unless i turn off the lock... perhaps this is something they can implement in the next version or do a quick update of the browser

    ''rojere [[#question-1055991|said]]''
    <blockquote>
    i try to keep my thumb palms off the mouse pad when i am typing but every now and then my screen resizes larger or smaller until i take my left palm off the keyboard base its only when my left palm is resting on the base next to the touch pad. i type pretty fast so it gets annoying and yes it also jumps screens or reverts back to previous message and i have to choose ctrl z to undo and get back to my message i was typing... it also switches tabs on me as well... not sure why my palm being on the left of the keypad on the base should effect anything but it does after a while. and i have to stop what i am doing...and go to the firefox menu and change the screen size back down to 100% sometimes it goes up to 200-300 other times it goes down to 70-80% i find it annoying i i wish there was a way to turn off the screen resize in the setup panel. if its just left to be 100% i am happy with that... i don't need it to be bigger or smaller... there should be a way to LOCK it down... i understand that there are people out there with eye problems and needs to have the screen size increase using the + or - but there should be a lock so it just stays no matter what is happening on my keypad or touch pad or base of the pad... that screen size will not increase or decrease. unless i turn off the lock... perhaps this is something they can implement in the next version or do a quick update of the browser
    </blockquote>
    sorry that is all greek to me thanks for attempting to explain what you were trying to explain sorry i just not tech person to be able to understand or where to begin ... have good day and thanks for again trying

  • I do not have a SIZE menu option on my new message box and the photos keep resizing very small

    Mail keeps reducing the size of photos in messages. I do not have a menu bar at the bottom to allow changes to size. I cannot find anywhere to change or allow me to have a resize control.

    The problem is that I do not have a size control, pop-up or other to select. I noticed on another similiar discussion there was an option at the bottom of the page but mine has none. I have checked for updates for Mail but I have everything up to date. As a last resort should I re-install Mail. If so, how do you do this ???. Thanks Rick

  • I have bad eyesight and normally run a browser @ easy to see size why doesn't the NEW version of FF keep resizing??

    First of all thanks for the browser...2ndly why does every website and it's grandmother require me to "register" with them. I have more accounts than the pentagon and am getting sick of it.
    I really do not like this new version but the plug-ins for the old one quit working so here we are.
    The old version I was using would let me ctrl + + my viewing window and SAVE it. Now everytime I open a window in FF it goes to default...so now I'm stuck with a browser I don't like compared to previous versions AND I can't see the print in the windows FURTHER straining my eyes. Now every window I open I have to resize (Zoom) the webpage in...every...time...Why??? Why do ppl change things that were working just fine??? Why make something so hideous??
    The older versions were just fine the way they were imo and thank you for them and I guess thx for trying on this version. Please consider going back to the older versions.

    Sorry, I'm not sure why Firefox 6 is no longer remembering your zoom settings, but installing the '''[https://addons.mozilla.org/en-US/firefox/addon/nosquint/ No Squint add-on]''' might help. No Squint provides options to remember zoom settings for specific web pages, or for all pages.

Maybe you are looking for