JTextArea as ListCellRenderer in JPanel with JSplitPane and text wrapping

Hi.
I have problem with JTextArea text wrapping. The JTextArea is used as ListCellRenderer in JList and it has set:
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);I can dynamically add new Notes, modify and remove notes on JList. The capacity of the Text is various so the size of cells is various.
The JList is in JScrollPane configured like this:
JList notesList = new JList();
JScrollPane scrollPane = new JScrollPane(
                    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                    JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
scrollPane.setViewportView(notesList);This scrollPane is put on the left component in the JSplitPane.
When I put one note with any capacity I want, word wrapping works great even if I move the splitter. The size of cells in JList changes as I want. When JList has more width the cells have less height, when JList has less width the cells height grows because of text wrapping.
Problem
Sometimes and I don't know when and why the cells size is fixed.
I put new note to the list, JList lays the cell, calculate the size and disply it. It is good but when I move splitter the size of the cell is the same. It seems that during moving the splitter the JTextArea doesn't calculate their size.
I would like in every cell in JList to see whole text wrapped. When I make more width by slider I would like to see whole text with less number of rows. When I make less width with the slider I want to see whole text wrapped and more higher cells.
Can someone help me where to looking for ideas.

Hi.
I have problem with JTextArea text wrapping. The JTextArea is used as ListCellRenderer in JList and it has set:
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);I can dynamically add new Notes, modify and remove notes on JList. The capacity of the Text is various so the size of cells is various.
The JList is in JScrollPane configured like this:
JList notesList = new JList();
JScrollPane scrollPane = new JScrollPane(
                    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                    JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
scrollPane.setViewportView(notesList);This scrollPane is put on the left component in the JSplitPane.
When I put one note with any capacity I want, word wrapping works great even if I move the splitter. The size of cells in JList changes as I want. When JList has more width the cells have less height, when JList has less width the cells height grows because of text wrapping.
Problem
Sometimes and I don't know when and why the cells size is fixed.
I put new note to the list, JList lays the cell, calculate the size and disply it. It is good but when I move splitter the size of the cell is the same. It seems that during moving the splitter the JTextArea doesn't calculate their size.
I would like in every cell in JList to see whole text wrapped. When I make more width by slider I would like to see whole text with less number of rows. When I make less width with the slider I want to see whole text wrapped and more higher cells.
Can someone help me where to looking for ideas.

Similar Messages

  • How to add a JPanel with label and border line

    hi,
    I want a Jpanel with label and border line like this.Inside it i need to have components.Is there a resuable component to bring this directly??
    Any solution in this regards.???
    Label-----------------------------------------------------------
    | |
    | |
    | |
    | |
    | |
    |________________________________________ |

    [url http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html]How to Use Borders

  • I'm trying to share to Media Browser a 20 minute still slide show with music and text. I have tried several times to save at 1080 HD, but just before it's finished, a message box pops up saying "File already open with write permission."  What's this mean?

    I'm trying to finalize/share to Media Browser a 20 minute still slide show with music and text. I'd like to finalize it 1080 hd and have tried several times, but just before it's finished, a message box pops up saying it can't be done because "File already open with with write permission."  What does this mean?  All files are closed; this iMovie project is the only thing open.  Does it mean one of the song files from iTunes? And should I just settle for saving it as a "large" file, which is what I'm trying right now?
    Thanks,
    Jamie

    Hi
    Error -49 opWrErr  File already open with write permission
    Trash the preference files while application is NOT Running.
    from Karsten Schlüter
    Some users notice on exporting larger projects from within iMovie that this operation is aborted with an 'error -49'
    This issue occours only on MacOs machines using 10.7x
    try switching-off the Local Mobile Backup
    in Terminal copy/paste
    sudo tmutil disablelocal
    Re-launch Mac
    See also this post
    https://discussions.apple.com/thread/4434104?tstart=0
    Yours Bengt W

  • Pdf (with graphics and text) in the email body

    When I place an pdf (with graphics and text) in the body of my email using Mac Mail my recipient sees them as attachments only. I am trying to find a way of presenting a formatted email with graphics that will appear the same way to all recipients, but a pdf frequently ends up being an attachment instead of staying in the body. The pdf  file doesn’t seem to always show up in the body as created. Is there a better way to accomplish this?

    You have no control over how your email maybe rendered by other email servers and client side software.
    Attachment Tamer may give you a few more options but it does not guaranty the end result.

  • Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance-..

    Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance…..

    LibreOffice

  • Want to send a email with images and text in the body of email in iOS

    In iOS, we have written a code to send an email,  with embedded images and text in the body of the email ( not attachment) using mail composer. It works well with iOS devices like iPhone and iPad, but does not work in window based OS. Can anybody help. The code is

    Thanks James !, do you have an idea how to  find the window resource which I belive will be included in our appllication pack.
    In above  I have missed to copy the code,below is the code. This might help you to help me.
    NSMutableString *imgContent = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];
    UIImage *imageData = [UIImage imageNamed:@"Midhun.png"];
    NSData *imageDataInBase64 = [NSData dataWithData:UIImagePNGRepresentation(imageData)];
    NSString *base64String = [imageDataInBase64 base64EncodedString];
    [imgContent appendString:[NSString stringWithFormat:@"<p><b><img src='data:image/png;base64,%@'></b></p>",base64String]];
    [imgContent appendString:@"</body></html>"];
    MFMailComposeViewController *emailWin = [[MFMailComposeViewController alloc] init];
    [emailWin setMessageBody:imgContent isHTML:YES];

  • Open Hub with Attributes and Texts

    Hi,
    I´d like to know if it´s possible to have one open hub (database table) with texts and attributes.
    There´s no problem when I create it or it´s transformations and DTP´s, but when I try to load texts, after attributes load, it always generates a dump: SAPSQL_ARRAY_INSERT_DUPREC.
    I´d like to know a way without using a DSO, any suggestions?!
    Kind Regards,
    Tomas

    Hi,
    Pls chk SAP notes system, check SAP note 668466 for some help for this error.
    *As according to SAP NOTE ;668466*
    Summary
    Symptom
    You load master data attributes or texts for a characteristic. The loading terminates with runtime errors of the type SAPSQL_ARRAY_INSERT_DUPREC or with error message RSDMD 199. The termination point is in the DBFIRE method of the CL_RSDMD_UPDATE_MASTER_DATA class.
    Other terms
    Loading master data, attributes, texts, SAPSQL_ARRAY_INSERT_DUPREC, CL_RSDMD_UPDATE_MASTER_DATA, DBFIRE
    Reason and Prerequisites
    When you load attributes or texts, data records are usually inserted in the master data tables of the characteristic using an array insert statement (P, Q, X, Y, T tables). This results in a SAPSQL_ARRAY_INSERT_DUPREC runtime error if data records that are to be inserted and that relate to the unique primary key of the relevant database table already exist in this table. The following possible reasons are currently known for the occurrence of the SAPSQL_ARRAY_INSERT_DUPREC runtime error:
    1. Data inconsistencies in the master data tables of the characteristic
    SAPSQL_ARRAY_INSERT_DUPREC runtime errors or RSDMD 199 may occur if the data appears in an inconsistent status in the master data tables of the characteristic before you load attributes or texts. Notes 323140, 566044, 592757 and 599269 describe this (among other things) in more detail.
    2. Parallel loading of nondisjunct data packages
    If master data attributes are loaded over several dialog processes that are running in parallel, you must guarantee that the data packages of the relevant request are strictly disjunct concerning the characteristic value. This means that all data records that belong to a certain characteristic value may only be contained in a single data package. If data records of a certain characteristic value are distributed over several data packages, this may cause conflicts during the parallel loading of these packages when the master data tables are accessed and this may result in SAPSQL_ARRAY_INSERT_DUPREC runtime errors.
    The same conditions that apply to loading attributes also apply to loading language-independent master data texts. If language-dependent texts are loaded in parallel, the data packages must be disjunct in relation to the combination of characteristic value and language indicator.
    Note 566044 also describes the problematic nature of nondisjunct data packages or duplicate or overlapping data records.
    3. Parallel loading of time-dependent attributes or texts
    When you load time-dependent attributes or texts, a data record that is to be loaded is assigned to a characteristic value and also specifically to a time interval within which the contained attribute values or texts are valid. For this reason, requests for loading time-dependent attributes or texts typically contain several data records for each characteristic value. If data records of a certain characteristic value or the combination of characteristic value and language indicator are distributed over several data packages, this may (as already explained) cause conflicts when the master data tables are accessed and may result in SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199.
    4. Delta update of an ODS object in a characteristic
    If you use a delta update from an ODS object to load master data attributes or texts, the activation of the ODS object determines the contents of the data packages that are used for loading the attributes or texts. If all of the ODS loading requests that are used as the data basis for the update into the characteristic are activated together in one step, this guarantees that the system sets up the data packages strictly disjunct in relation to the key fields of the ODS object. If the key fields of the ODS object are displayed one for one on the compounded characteristic value in the update rules, the data may be updated to the characteristic in parallel and by package.
    However, if ODS loading requests that were activated at different times appear in the data basis for the update, data records of a certain ODS key or characteristic value may be distributed over several data packages. As already explained, this may cause conflicts when you access master data tables of the characteristic, and it may result in SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199.
    This problem is also described in Note 666213.
    5. Simultaneous loading of attributes and transaction data
    If, when loading attributes of a characteristic, you discover that there are still no entries in the master data tables (P, Q) for a specific characteristic value, the system prepares to insert corresponding data records into these database tables. You can load transaction data into an InfoCube or an ODS object, for example, with the option to create missing master data entries for characteristics that involved during the loading. If a request now creates entries for transaction data in the master data tables (P, Q) of the characteristic before the process has inserted corresponding data records into the master data tables (P, Q) for loading attributes for this characteristic, this may result in a SAPSQL_ARRAY_INSERT_DUPREC runtime error or error message RSDMD 199.
    This problem may also occur if you load attributes simultaneously for a characteristic that contains the other characteristic as a navigation attribute or compounding part. If a characteristic is compounded to other characteristics or if it contains characteristics other than the navigation attributes, the system also creates SID values for these dependent characteristics when the attributes are loaded depending on the settings in the InfoPackage.
    Solution
    To repair a possible inconsistency in the data, implement the RSRV test for master data.
    To avoid SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199 when you load master data, carry out the following actions. The actions to be performed in each case depend on which of the above-mentioned reasons is responsible for the runtime error:
    1. Data inconsistencies in the master data tables of the characteristic
    If data inconsistencies are responsible for the runtime error, you can usually use the tests in transaction RSRV or the RSDMD_CHECKPRG_ALL program to solve this problem. Notes 323140, 566044, 592757 and 599269 describe these (among other things) in more detail. If you cannot implement an automatic correction in this way, you may have to use an ABAP program that is adjusted to the relevant situation to restore the data consistency.
    2. Parallel loading of nondisjunct data packages
    If the runtime error does not lead back to the parallel loading of nondisjunct data packages, you must identify the duplicate data records that cause the problem. As described in Note 566044, you can change the insertion into master data tables from one array insert to an individual insert statement. If you use a single record insert statement to insert data records, duplicate data records are logged in the monitor by error messages (RSDMD 196). If the data records of a failed request are still available in the PSA, you can also search for duplicate data records directly in the relevant PSA table.
    You may also create duplicate data records if key values are changed in the transmission rules or update rules. If relevant rules are defined, you should check these to see if they can possibly create duplicate data records. If this is the case, you must correct the rules accordingly.
    3. Parallel loading of time-dependent attributes or texts
    The extractors used for loading time-dependent attributes or texts cannot guarantee that all data records assigned to a certain key value are contained together in only one data package. For this reason, to avoid SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199, you should not load time-dependent attributes and texts in parallel. Data packages are processed serially if the 'PSA only' and 'Update Subsequently in Data Targets' settings under 'Processing' are used in the InfoPackage.
    4. Delta update of an ODS object in a characteristic
    To avoid SAPSQL_ARRAY_INSERT_DUPREC runtime errors or error message RSDMD 199 during the delta update from an ODS object to a characteristic, you must ensure that the data basis used for the update to the characteristic consists exclusively of ODS loading requests that were activated together in one step only. Note 666213 describes in detail how you can ensure this.
    5. Simultaneous loading of attributes and transaction data
    If the runtime error occurs because another load task creates SID values or master data for the same characteristic at the same time when attributes are loaded, you can only solve the problem by rescheduling. The load task in question must be scheduled in such a way that you can exclude simultaneous processing.
    *pls assign points,if info is useful*
    Regards
    CSM reddy

  • Ipad app with gallery and text

    good evening,
    i hope some one will be able to help me.
    i saw a tutorial where a lay photographer showed how to make a gallery ( on the left side) with scrollable text on the right. i was so dumb not to save or bookmark the url.
    Is there anyone where I can find this tutorial? I thought it was Julieanne Kost, the Adobe evangelist, but she replied that she didn' t make that tutorial.
    in the tutorial you see the pictures and the text on the right on an iPad
    please help me

    Sounds like a multiple-state-object (MSO )with scrolling frame text would work. I would set up my pictures as buttons on the left which would have a go to state action for the MSO. Each state would hold the scrollable text frame and the associated copy for the picture. Here's a link on scrollable text frames Digital Publishing Suite Help | Scrollable Frame overlays. Also look at DPS tips DPS Tips on the App Store on iTunes for MSO and Scrollable Frame examples.

  • How to send a e-mail from folio with subj and text

    Hello!
    I need send an e-mail from folion. I knew how to make hypperlink but a need not only subj and address. I need a text there. Can somebody explain how it's should be?
    Best regards

    You can make an object have a mailto: hyperlink that has subject and body variables included.
    It would look like this:
    mailto:[email protected]?subject=Subject-text-goes-here&body=Body-text-goes-here
    Fill in the variables with your own text, and make sure to replace spaces in your subject and body text with figure dashes.

  • Problem with images and text displaying correctly

    I don't really know how to explain this problem and I had two screenshots ready to upload to show the before and after but we apparently can't upload photos now...SOOOO I will try my best.
    The issue began when I got a new computer at work (Windows 7 instead the Windows XP everyone else has) and was/is present for me in InDesign CS2 and since we were planning on updating to CS5, I figured that having an updated version would fix whatever issue it was. That was a wrong assumption unfortunately.
    When I open any document, all images and text are displayed properly until I scroll up/down or side-to-side and NOT using the scroll wheel for up/down. This is probably so confusing and I'm sorry I can't describe it better...the mouse I use has two programmable buttons that I set to coast up and down and to go side-to-side I can push the scroll wheel to one side or the other and it coasts that direction. When I do either of those things, the text looks like it is permanently greeked and the images look....weird lol like they are in 16 bit or something like that. To fix the problem in CS2, I have to click and hold on a text block until I am able to adjust text so that I can see it adjust in real-time. In CS5, I have to do the same basic thing except I don't have to click and hold as it does that by default (awesome feature btw!!)
    I have already updated my graphics card driver (Nvidia 9400 GT 1GB) and my processor driver (Intel Core2Duo 3.0ghz) and I have 4GB of RAM. I tried updating both CS2 and CS5 but both are updated already. I've also tried doing the whole inx. export and cleaning the preferences file or whatever that is called. Nada. If someone thinks they can help me, I can send them the two images I was going to upload here. Email me at justgeig (at) gmail (dot) com Thanks in advance!

    maybe greeked isn't the right word...i don't know how to explain it
    here is the correct view. It is much more noticable when the whole document shows this.

  • IWeb - Text disappears in iFrame with movie and text!?

    I have an iFrame in one of my pages that works to give the functionality of a submenu.
    This submenu is contained in the "Music" page shown in the top menu. The iFrame is for dynamically loading the content of the different "subpages" when clicking on the submenu items. Because Film Music is the first (and default) item of my submenu, this is what comes up when you select "Music" in the top menu:
    In this case, everything from the big Film Music title and below is what is contained in the iFrame. That is the content that gets changed when selecting the other submenu options (TV Music, Records and Advertising Music).
    Here's the problem:
    When clicking "Music" on the top menu, this default submenu page (the one shown above) never breaks. However! Once I start navigating through the submenu options (e.g. TV Music, Records, etc...) any page that loads in the iFrame that has both video and text (like this Film Music one) becomes unreliable! Sometimes it shows up fine, and others, the text from the iFrame disappears! The video stays there.
    I magically found out that if I scroll the page, the text comes back. The only thing getting affected is the content of the source page that gets loaded in the iFrame. Why is this happening??

    When clicking "Music" on the top menu, this default submenu page (the one shown above) never breaks. However! Once I start navigating through the submenu options (e.g. TV Music, Records, etc...) any page that loads in the iFrame that has both video and text (like this Film Music one) becomes unreliable! Sometimes it shows up fine, and others, the text from the iFrame disappears! The video stays there.
    I magically found out that if I scroll the page, the text comes back. The only thing getting affected is the content of the source page that gets loaded in the iFrame. Why is this happening??
    I read it in your other post. Must have missed it.
    I noticed the same problem in my iframe page.
    I think it's some Safari issue.

  • Planning Layout Column Width and Text Wrapping

    Hello,
    Is there a way in a BPS layout to set the column width to a certain length and have the column heading texts wrap?  I noticed an answer for adjusting a table API for BW Web columns, but not BPS.
    Thanks,
    Cherie

    A coworker figured out by selecting the line break in the change subcomponent it wraps the column text.

  • Is there a way to zoom and text wrap on ipad safari

    Dear all
    Now I am in iOS 6 and still the text doesn't wrap on safari *after pinch and zoom*
    So one is forced to keep scrolling to read *every* line !! And that is annoying
    The grey reader ikon does NOT appear on all web pages ...I know I know there are limitations
    So what is the solution to wrap text on a web page after pinch and zoom ?
    Does one have to still run around to other browsers ( like atomic or whatever ) or is there some hope in safari ?
    Or should one go to the android world ?
    Or what ?
    I tried installing the readeability book marklet but that too does NOT work on all pages ( again checked on safari )
    SO IT BOILS DOWN TO word wrap on safari OR whatever browser after pinch and zoom
    Is there a way to wrap text AFTER pinch answer zoom on safari ?
    Any help , tips, workaround (free ) would be appreciated whole heatedly
    TIA
    regards
    Subu

    Thanks for the reply James
    I am NOT sure if we are on the same page / same understanding ...so let me try again
    All below on an ipad 2, iOS 6+ OS , all legal NO jailbreak
    1. Take a sample public page ...example http://www.sec.gov/Archives/edgar/data/50104/000005010413000019/tso10k2012-ex322 .htm
    2. Pl open this on an iOS ...mobile safari browser
    3. When I open it on my ipad 2 , iOS 6+ OS browser I do NOT see the reader facility and for my old eyes the font is small
    4. However BEFORE zoom the text IS properly text wrapped to fit inside an iPads screen
    5, I need to read this page , as I said the font is too small for me , so I pinch and zoom on my safari page as displayed on ipad 2
    6. Now the lines are longer than the ipad screen and I need to keep scrolling left and right to read any line fully !!!
    7. I want the text to be aligned AFTER zoom
    8. Am I making myself clear ?
    Thanks in advance for your tips , ideas
    Regards
    Subu

  • To JPG - JPanel(with JTable and g) on JScrollpane

    hi need help on this one, i have a JPanel inside a scrollpane that i want to convert to JPG. This JPanel contains Tables labels and some drawings.
    everytime i convert it to JPG the only thing that shows up is the one that im seeing in the screen meaning what is being viewed by the JScrollPane. The other parts i dont get to save.
    But what i need to save as JPEG is the whole panel even outside of the view of the Scrollpane.
    how do i do this... please help
    thanks very much
    here is a code that i used, i pass the scrollpane component to this
    public static void saveAsJPEG(Component component,
    float quality, String filename) {
       try {
         Dimension d = component.getSize();
         d.height = 657;
         BufferedImage bimage = new BufferedImage(d.width, d.height,
                                   BufferedImage.TYPE_INT_RGB);
         component.paint(bimage.createGraphics());
         Graphics2D g = (Graphics2D)bimage.getGraphics();
         g.setPaint(Color.white);
         if(!filename.endsWith(".jpg"))filename += ".jpg";
         OutputStream out = new FileOutputStream(filename);
         JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
         // Create JPEG encoder
         JPEGEncodeParam jpegParams =
                 encoder.getDefaultJPEGEncodeParam(bimage);
         jpegParams.setQuality(quality, false);
         // Set quality to (quality*100)% for JPEG
         encoder.setJPEGEncodeParam(jpegParams);
         encoder.encode(bimage);
         // Encode image to JPEG and send to browser
         out.close();
         JOptionPane.showMessageDialog(null,"File successfully saved");
         catch (Exception e) {
         System.out.println(e);
    }           

    Torsten hey!! thanks very much, thats dukes for you
    follow up question though,
    how do i do it when it comes to printing? if its not much bother can you send me a snippet for same procedure but passed to a printing api or something.
    Thanks very much again in advance
    aloyse

  • IPhone 3GS multiple problems with calls and text

    I have AT&T for service provider and I am having these problems with the THIRD Iphone 3Gs that I have received since Jan 12.
    I  turned off 3GS again after newest update, not sure if it willl help or not.
    Also, I have the same problems with this phone as previous 2 Iphones I got at Apple Stores:
    * sporadically drops calls -  even if I don't move from the spot I originally called from.  This is my only phone, so I need to make and receive any calls to this phone.
    *"Searching", "No Service", so text messages don't get sent, but I don't know that unless I check back to see the red ! and I keep trying to resend...
    * No SIM card - but, only know this if I check, not good when busy and waiting for a call or text.
    Do I need to go to an Apple store again (not nearby me) to replace it before my replacement warranty runs out?
    Thanks for any help!

    Try powering the phone off, then removing and replacing the battery, and powering the phone back on. 
    Then try  dialing *228 send and option 2 on the phone to update the PRL.
    Then try closing down applications that you are not using on the device.
    From the home screen, touch the applications tab (located at the bottom of the display).
    Touch Settings.
    Touch Applications.
    Touch Running services.
    Touch a service you are not using then.
    Touch Stop.
    From the home screen, touch the applications tab (located at the bottom of the display).
    Touch Settings.Touch Applications.Touch Running services.
    Touch a service you are not using then.
    Touch Stop.
    Repeat steps as needed.

Maybe you are looking for

  • I'm also getting the dreaded Blue Screen Of Death when I boot into Windows

    This happened right after I upgraded to the most recent version of iTunes. Everytime I initially boot the computer, it would get into Windows, crashes immediately, then my system reboots and I'm able to get into windows no problem. Reading the help s

  • WORD COMPATIBILITY ISSUE

    I just recently switched to a Macbook Pro and used the Migration Assistant to transfer all my files from my PC to my new Mac. I have installed Microsoft Office on my new Macbook as well. I opened a file today, tried to edit it, and then save my work

  • Reverse/Cancel Outbound Delivery and Billing documents

    Hi all, My question is...How do you reverse/ Cancel Outbound delivery and billing documents and what will be the reversals in  Accounting document and how are they updated. Regards

  • Repeated requests for authorization after migration to 10.6

    Recently migrated from my old eMac to a new Mini running OS10.6. Itunes repeatedly asks for authorization on certain songs - those bought with an old AOL ID back in the day. I enter the ID and PW, then itunes tells me this ID has been changed to an A

  • How do I exclude my Trash? Is it part of System or my Home?

    Hi Everybody, I just received my TC on Monday and would like to use Time Machine for backing up my Home directory but don't want the contents of my Trash; I don't want to delete my Trash either. I'd like to keep the content for a few more weeks until