Can you limit the size of a TextArea?

I've developed a program which logs what it does into a file as well as into a TextArea component. We've just realised a potential problem though in that this program may be left running several weeks at a time and the TextArea could become very full and tie up a lot of memory.
So basically I need a good solution for limiting its size. I thought that each time it could clear itself and read through the log file for, say, the last 50 events but that process may also start taking a long time if the log file gets big too.
Any solutions?
Both the file logging and textarea logging are handled by a seperate class. There is one log() method which accepts a string and takes care of both.

Its easily done on a JTextArea. Basically every time the text area is updated you check the number of lines in the text area and remove any lines above your limit.

Similar Messages

  • Can you limit the list of AirPlay devices seen on the iPad if multiple devices exist?

    We are setting up a school to use iPads, Apple Tvs and Projectors in classrooms.
    - Teachers are using iPads in classrooms and we are setting up wireless projection using AirPlay.
    - Each classroom has an Airport Express with a unique WiFi name.
    - Each classroom has a projector with an Apple TV mounted on it and each Apple TV has a unique AirPlay name.
    - An iPad and the AppleTV are the only two devices on each classroom’s wifi.
    - When a teacher wants to mirror iPad to the projector, we thought they would just see their own AppleTv (projector) but, I think because the underlying school network is the same in each classroom, the teacher sees every device in the school.
    Question:  If you have multiple AirPlay devices on the same network, can you limit the list that one sees on an iPad?
    And/or: Is there a way to set up the wifi differently so the teacher is not presented with a huge list of devices?

    I wish teachers like you would leave technology you don't understand alone. The fact you were allowed to plug-in "consumer grade" access points into a enterprise network says a lot about your lack of knowledge; next you want to turn all of these low end access points into routers!? Your going configure a unique SSID on every AP setup each device to only connect to that network? Do you have any consent of wireless networks? Management?
    It's teachers like you that bring down a network. Then you insult the very IT staff that work in a very thankless position in which most of their interaction occurs when something doesn't work.

  • I want to be able to paste a bunch of text into the subject line buit to only keep the first maybe 50 characters. How can I limit the size of the subject line?

    I need the ability to paste a bunch of text into the subject line but for it only to capture the first 50 or x number of characters. Can I limit the size of the subject line characters somehow in an ini or profile setting?

    If your problem is with Mozilla Thunderbird, see this forum for support.
    [https://support.mozillamessaging.com/en-US/home] <br />
    or this one <br />
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Can you increase the size of the photo that shows when you receive a call from a contact

    Can you increase the size of the photo that shows when you receive a call from a contact ?

    It used to be if you added the contacts photo on the iOS device they would have a large picture and if you added it from Address Book on OS X they would have a smaller thumbnail.  However, since iOS5, all I've been able to get is the larger photo.  Try adding the picture directly in the contacts app on your device.  That should make it larger.

  • Switcher ?Can you change the size of the screen resolution on the Macbook?

    I'm really interested in buying a Macbook. This will be my first Mac. I love the way they look and feel. I'm concerned with the size of everything on the Macbook. The overall size of the fonts in applications such as word, or safari was too small for me.
    Can you change the size of the screen resolution in OSX like you can on Windows? In Windows doing this makes everything visually bigger.
    Please say you can. I'm really wanting the Macbook as it would be great for for a student like me.
    Thanks in advance.
    Hopefully a Macbook 13" 2.0 Superdrive soon.
    Hopefully a Macbook 13" 2.0 Superdrive White soon.

    With an LCD, if you change the resolution, things will be bigger, but blurrier.
    You can however keep the resolution of the LCD at its native resolution, giving the maximum picture quality, and then use tools, such as Tinkertool…
    http://www.versiontracker.com/dyn/moreinfo/macosx/11967
    … to modify the font display size of items such as the menu bar, Finder labels etc etc.

  • How can you shrink the size of an upright picture to make it smaller without losing any of the detail in it??? At the moment, if I view them on my laptop, landscape photos fill the screen, but portrait photos only show the middle part.

    How can you shrink the size of an upright picture to make it smaller without losing any of the detail in it (in Slideshow)??? At the moment, if I view them on my Mac Laptop, landscape photos fill the screen, but portrait photos only show the middle part, so I loose the top and bottom of the picture.  Have tried cropping, but that means I lose top and bottom part of the picture, so that is not the answer!!

    Homestly haven't a clue what's going on there. 
    Try trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder.
    (On 10.7: Hold the option (or alt) key while clicking on the Go menu in Finder to access the User Library)
    (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    What's the plist file?
    For new users: Every application on your Mac has an accompanying plist file. It records certain User choices. For instance, in your favourite Word Processor it remembers your choice of Default Font, on your Web Browser is remembers things like your choice of Home Page. It even recalls what windows you had open last if your app allows you to pick up from where you left off last. The iPhoto plist file remembers things like the location of the Library, your choice of background colour, whether you are running a Referenced or Managed Library, what preferences you have for autosplitting events and so on. Trashing the plist file forces the app to generate a new one on the next launch, and this restores things to the Factory Defaults. Hence, if you've changed any of these things you'll need to reset them. If you haven't, then no bother. Trashing the plist file is Mac troubleshooting 101.

  • Can you limit the amount of data accessed per user on an AirPort Extreme?

    Can you limit the amount of data accessed per user on an AirPort Extreme?

    Your question was whether the AirPort Extreme is able to establish data limits per user.
    If you add another router that has this type of capability or install software on another router, then you will be able to establish data limits for each user. The AirPort Extreme will have no control over this.

  • Can you increase the size of your contact photos on the BB Style?

    When a call comes in, is there a way to increase the size of the photo to actually be able see who it is whose calling?  I mean when they say "thumbnail" photo, they aren't kidding!

    From within the phone, no you can't increase the size of the display photo.
    There are apps available in AppWorld which may be able to accomplish this but that's the only way you'll be able to adjust the size.
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • How can I limit the size of a file upload?

    I am uploading a file using a file reference using the code below.  I want to  limit the file size (bytes) of the uploaded file to 100k, so that a huge file won't crash the browser or my SWF.
    What's the best place in the following process to test this, and actually prevent the large file from being loaded?  Is that even possible?
    private function uploadImageBtn_clickHandler() : void {
         var arr:Array = [];
         arr.push(new FileFilter("Images", "*.gif;*.jpeg;*.jpg;*.png"));
         fileRef.browse(arr);
    private function fileReference_select(evt:Event):void {
         fileRef.load();
    private function fileReference_complete(event:Event):void {
         var loader:Loader = new Loader();
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
         loader.loadBytes(fileRef.data);
    public function loader_complete (event:Event) : void {
         trace("Loader info = "+event.currentTarget.bytesLoaded); // file size in bytes
         var sourceBMP:Bitmap = event.currentTarget.loader.content as Bitmap;
         bgImage.source = sourceBMP; 

    Thank you. I just needed to be pointed in the right direction. After looking over this stuff, including FilePermission, I think this may give me what I was looking for. It will be a while before I get to implementing it or testing something like this, I'm just trying to get a grasp on all of the things I need to do and how to approach it.
    By doing this I can control how much filespace it can use.
    I can control CPU usage by monitoring for extra threads that don't belong and killing or settings the priority on it.
    Now I just need to think of something to monitor how much memory the plugin uses. I suppose I could gc, then store the current memory usage, then execute the plugin, gc again, and measure the size again. Does that sound like a reasonable way to estimate it's memory usage? I'm not looking for tiny changes, I just want to see large, substantial increases.

  • Can you change the size subject field on the voice over for like reading the news paper

    i been playing around with the functions on my mac and i discoverd "voice over" a little annoying cause it just verbalizes everything, but i thought it would be kinda cool to have it read me the paper in the morning while i drink coffee and get ready for the day. however it only reads a small suject field one at a time .i was wondering if you can expand the size of the subject field to encompass more text if you know what i mean

    HI,
    You  cannot change the PIc size of the Buddy on the Buddy List or in the Messages (Chat) window.
    In the View Menu you can turn off the Buddy Pics (Depending if the Buddy List or Messages window is the "Front" one when you use that Menu).
    10:10 PM      Thursday; September 20, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and and iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Can you change the size of the buddy icons in Messages?

    In Mountain Lion Messages, I have a lot of simulataneous chats going on.   The icon sizes for my buddies is too large for me.  I'd like it to be smaller so I can see more buddies on my list of concurrent chats withough having to scroll down to see them.   Any idea how I can change this?

    HI,
    You  cannot change the PIc size of the Buddy on the Buddy List or in the Messages (Chat) window.
    In the View Menu you can turn off the Buddy Pics (Depending if the Buddy List or Messages window is the "Front" one when you use that Menu).
    10:10 PM      Thursday; September 20, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and and iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Can you change the size of the preview images on an Apple TV without changing video resolution?

    I have a 32 inch LCD TV. My room is relatively large and I can't easily see the preview images or read the text on the TV across the room. Is it possible to change the size of preview images in the menu screens without increasing the resolution of the TV itself? I think this should be possible, but can't seem to find a way to do it.

    No that's not something you can do on the Apple TV.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here.

  • How can I limit the size of a file generated by 3rd party code?

    I have a program that loads plugins from a directory and executes code in those plugins. These plugins are classes that implement a standard interface within my API. I want to be able to monitor for files generated by these plugins. Usually there are no more than 2 plugins running at once, so I could end up with 2 plugins writing files. An example would be a plugin creating an SQLite database on the filesystem.
    I could monitor the current directory and guess who's file it is, but what if the files get written elsewhere? Can I do something in Java that limits what directories the Java process can write to?
    I wouldn't mind being able to track their memory and CPU usage, but I don't think I can do much about that.

    Thank you. I just needed to be pointed in the right direction. After looking over this stuff, including FilePermission, I think this may give me what I was looking for. It will be a while before I get to implementing it or testing something like this, I'm just trying to get a grasp on all of the things I need to do and how to approach it.
    By doing this I can control how much filespace it can use.
    I can control CPU usage by monitoring for extra threads that don't belong and killing or settings the priority on it.
    Now I just need to think of something to monitor how much memory the plugin uses. I suppose I could gc, then store the current memory usage, then execute the plugin, gc again, and measure the size again. Does that sound like a reasonable way to estimate it's memory usage? I'm not looking for tiny changes, I just want to see large, substantial increases.

  • Can you change the size of the menu bar text ?

    I am getting on in years and it is harder to read the text in the menu bar. Is it possible to change the size of the text in the menu bar ?

    Christopher,
    Also If you want, you might look into the "Zoom" Accessibility feature.
    System Preferences > Accessibility > "Zoom" in the list on the left > Pick the Zoom settings you like.
    I myself am fond of and use the options "Use scroll gesture with modifier keys to zoom:" and Zoom Style: "Picture-in-Picture"
    The "Picture-in-Picture" makes a little magnifying like glass that follows my cursor around compared to the whole screen zooming in.
    The Modifier key one makes so that When I hold down ( Control ) and scroll it zooms in. You can control the depth of the zoom by scrolling more or less.
    Apples Help info on Zoom:
    https://help.apple.com/machelp/mac/10.10/index.html?localePath=en.lproj#mh40579
    Hope that helps,
    Weston

  • Where can you see the size of your image?

    Hi all,
    For contests and such, I need to know the size of my images. I don't know where the size--in inches--displays in LR, so I always have to export to Photoshop to see what the size of the image is at different resolutions (240ppi, 300ppi, 600ppi). There must be a way, can anyone fill me in?
    Thanks!
    Alec

    You wrote:
    "images are by and large worthless in the real world unless they are printed in some fashion which requires inches"
    Yes, but that does not mean that images on your computer (your hard drive) have a dimension in inches. The size in inches is determined on output for printing and varies according to the resolution that you choose for the print. For instance if you have an image with a pixel size of 2000 x 3000 pixels - if you print it at a resolution of 300 ppi / dpi the image size in inches will be 6.66" x 10". If you print it with a resolutin of 200 ppi / dpi the size in inches will be 10" x 15"; and if you print it with a resolution of 100 ppi / dpi the size will be 20" x 30". Of course, a print resolution of 100 ppi / dpi is only theoretical, because the quality of the print will be awful, and if you want to print an image of 2000 x 3000 ppi in a size of 20' x 30' you have to upsample (enlarge) it first.
    So size of an image in inches is detyermind by the formula: pixel amount / resolution in ppi/dpi.
    ppi = pixels per inch - ppi is used when we talk about an image on screen
    dpi = dots per inch - dpi is used when we talk about print output.
    You also wrote:
    "LR printing is fine for snapshots but insufficient for printing from large format printers for fine art."
    Why, do you say that? Printing from LR is not substantially different than printing from Photoshop. LR gives you the same printing options as does Photoshop.
    I suggest you have a second look at the Print Module in LR.
    WW

Maybe you are looking for

  • Queries Published to Workbook Roles

    Hello Gurus, I need some advice on this particular situation. I currently have users in our BI systems (BI 7.0) that are assigned to roles specifically for workbooks to use with the BEX analyzer. In this case there are users who can publish queries t

  • Need an answer for security question

    Hi! I don't remember my answer of my security questions. How can I do help me plz

  • Dynamic Drop-Down Menu Solution

    Hi All, After spending a lot of time trying to find a good solution for a dynamic drop-down menu, I end up writing my own. The solution is for a list of items, having ITEM as the primary key of the table and ITEMDESCRIPTION as the list of options for

  • Report Error: No Applicaple Data Found

    Hi All, Good Evening BI 7.0 Report I have simply Drag and drop some Char (rows) and some Key(colum) then Executed but, i am not able to see the report. It saying No Applicaple Data Found. What to do, Please provide solutions, please. Thanks & Regards

  • Attribute unit in query

    Hi gurus, In my query, i have used the keyfigure attribute. on the attribute i have created the formula variable. moving price is the attribute with unit USD price unit is the other attribute with unit LB i have created two formula variable with repl