JTextAreaCellRenderer to wrap text in multiple columns... any better way?

I would like to use a basic JTextArea cell renderer to wrap the text in a JTable cell, like in this thread
http://forum.java.sun.com/thread.jspa?threadID=664671&messageID=3893724
Although the technique works, a disadvantage is that it cannot be used "as is" for multiple columns due to the setRowHeight/revalidate issue. One suggested workaround was to keep track of the maximum row height, as described here:
http://www.javaspecialists.co.za/archive/newsletter.do?issue=106
Both seem a bit rough. Are there any other options or more efficient techniques for automatically wrapping text in a JTable cell?

Hello, did you search online? there are many tutorials like this one: http://www.photoshopessentials.com/photoshop-text/text-effects/text-wrap/
You simply create a path, substract the parts you do not need, then click with the text tool inside.
Note that it is not a dynamic text wrap, you need to change it if you move the objects around.

Similar Messages

  • Is there any better way for updating table other than this?

    Hi all, I need to update a row in the table that require me to search for it first (the table will have more than hundred thousands of row). Now, I am using a LOV that will return the primary key of the row and put that primary key to DEFAULT_WHERE property in the block and execute query command to fetch the row that need updating. This works fine except that it require 2-query-trip per update (the lov and the execute_query). Is there any better way to doing this? This update is the main objective for my application and I need to use the most effective way to do it since we need to update many records per hour.

    Thanks Rama, I will try your method. Others, how to query row instead of primary key? I thought that querying primary key is faster due to the index?
    BTW, what people do if you need to update a table using Form? I have been using the LOV then execute query since I first developing form. But I am building a bigger database recently that I start worrying about multiple query trip to dbms.
    FYI my table will have up to million rows on it. Each row will be very active (updated) within 1-2 weeks after it creation. After that it will exist for records purposes only (select only). The active rows are probably less than 1% of all the rows.

  • How to create a function with dynamic sql or any better way to achieve this?

            Hello,
            I have created below SQL query which works fine however when scalar function created ,it
            throws an error "Only functions and extended stored procedures can be executed from within a
            function.". In below code First cursor reads all client database names and second cursor
            reads client locations.
                      DECLARE @clientLocation nvarchar(100),@locationClientPath nvarchar(Max);
                      DECLARE @ItemID int;
                      SET @locationClientPath = char(0);
                      SET @ItemID = 67480;
       --building dynamic sql to replace database name at runtime
             DECLARE @strSQL nvarchar(Max);
             DECLARE @DatabaseName nvarchar(100);
             DECLARE @localClientPath nvarchar(MAX) ;
                      Declare databaselist_cursor Cursor for select [DBName] from [DataBase].[dbo].
                      [tblOrganization] 
                      OPEN databaselist_cursor
                      FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                      WHILE @@FETCH_STATUS = 0
                      BEGIN       
       PRINT 'Processing DATABASE: ' + @DatabaseName;
        SET @strSQL = 'DECLARE organizationlist_cursor CURSOR
        FOR SELECT '+ @DatabaseName +'.[dbo].[usGetLocationPathByRID]
                                   ([LocationRID]) 
        FROM '+ @DatabaseName +'.[dbo].[tblItemLocationDetailOrg] where
                                   ItemId = '+ cast(@ItemID as nvarchar(20))  ;
         EXEC sp_executesql @strSQL;
        -- Open the cursor
        OPEN organizationlist_cursor
        SET @localClientPath = '';
        -- go through each Location path and return the 
         FETCH NEXT FROM organizationlist_cursor into @clientLocation
         WHILE @@FETCH_STATUS = 0
          BEGIN
           SELECT @localClientPath =  @clientLocation; 
           SELECT @locationClientPath =
    @locationClientPath + @clientLocation + ','
           FETCH NEXT FROM organizationlist_cursor INTO
    @clientLocation
          END
           PRINT 'current databse client location'+  @localClientPath;
         -- Close the Cursor
         CLOSE organizationlist_cursor;
         DEALLOCATE organizationlist_cursor;
         FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                    END
                    CLOSE databaselist_cursor;
                    DEALLOCATE databaselist_cursor;
                    -- Trim the last comma from the string
                   SELECT @locationClientPath = SUBSTRING(@locationClientPath,1,LEN(@locationClientPath)-  1);
                     PRINT @locationClientPath;
            I would like to create above query in function so that return value would be used in 
            another query select statement and I am using SQL 2005.
            I would like to know if there is a way to make this work as a function or any better way
            to  achieve this?
            Thanks,

    This very simple: We cannot use dynamic SQL from used-defined functions written in T-SQL. This is because you are not permitted do anything in a UDF that could change the database state (as the UDF may be invoked as part of a query). Since you can
    do anything from dynamic SQL, including updates, it is obvious why dynamic SQL is not permitted as per the microsoft..
    In SQL 2005 and later, we could implement your function as a CLR function. Recall that all data access from the CLR is dynamic SQL. (here you are safe-guarded, so that if you perform an update operation from your function, you will get caught.) A word of warning
    though: data access from scalar UDFs can often give performance problems and its not recommended too..
    Raju Rasagounder Sr MSSQL DBA
          Hi Raju,
           Can you help me writing CLR for my above function? I am newbie to SQL CLR programming.
           Thanks in advance!
           Satya
              

  • How to find out whether my Iphone 3Gs is officlially unlocked ( factory unlocked ) or "made" unlocked ? Can I upgrade its OS to OS 5 even if my phone is "made" unlocked ? how to up gared its OS ? are there any better ways to do it ?

    How to find out whether my Iphone 3Gs (OS version 3.1.3) is officlially unlocked ( factory unlocked ) or "made" unlocked ? Can I upgrade its current OS 3.1.3 to OS 5 even if my phone is not officlially unlocked ? how to up grade its OS ? what are there any better ways to do it ?
    Thanks,
    PRANAJ

    Depends wher you obtained the iPhone from and it's original supplier
    If the iPhone is an authorised unlock ( approved by the carrier) or was
    purchased from Apple as an unlocked iPhone  updating the iOS
    will have no effect on the iPhone and it's lock status
    HOWEVER if the software has been tampered with to remove the lock,
    updating the iOs will lock the iPhone back to the original carrier who holds the lock
    To find out the status of your iPhone  you could call Apple support
    and they may tell you if the iPhone is locked or not and if it is which carrier

  • Is there any better way to test an agent?

    Every time when I changes some code in the agent, I have to restart the domain to load the new class file. I tried the reload the agent from the Oracle Enterprise Manager, but it is not working. The old agent is still going on. It gives me many troubles since I can't start the SMB server from Window 2000 terminal console. I have to go to the computer room to start SMB natively. Is there any better way to test an agent or start the SMB server in the Window 2000 terminal console?
    Your help will be greatly appreciated!

    Jailcorder requires a jail broken iDevice to work. While it is not illegal to jail brake your iPhone in the US it is illegal to jail break an iPad.
    If you do that you will not be able to use these board for help as the discussion of anything relating to a jail broken iDevice is against the TOU and the hosts will remove your posts
    In addition looking tha Jailcorder it seems it has not kept up with Apple. It doesn;t  work Xcode 5 and  IOS 7.
    On final thing to keep in mind a jail broken device behaves differently then one that is non jail broken. So even of you test with Jailcode you will still need to go through testing with a non jail broken device before submitting.
    All in all if you are serious about developing for IOS it would seem the better course is to get the Developer account now.
    regards

  • Wrap text in Report column

    Hi,
    I've tried to set a standard report's column width in all available places in the column's attributes but it ignores me. I'm using Apex 3.1 and found a javascript workaround but am sure there must be an easyer way.
    Can someone tell me where I have to set the width so it wraps text into the needed amount of lines? I searched for it because I was sure there'd be something but not found nothing (maybe not searching right :p )
    Thank you,
    Marc

    Hi Chris,
    Done what you said but the column still takes the width of it's content. Any idea why might that be?
    The only solution I've found that works for now is this javascript process:
    Standard Report Column
    Marc

  • Need to wrap text in af:column

    Hi,
    i have a af:column with output text. Need to wrap the text in output text. Tried setting the NoWrap to false, but did not work. Below is the code. I really appreciate if someone could help me in fixing this issue.
    <af:table value="#{bindings.POC.collectionModel}"
    var="row"
    rows="#{bindings.POC.rangeSize}"
    emptyText="#{bindings.POC.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.POC.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.POC.collectionModel.selectedRow}"
    selectionListener="#{bindings.POC.collectionModel.makeCurrent}"
    rowSelection="single" id="t9"
    inlineStyle="width:100.0%; height:100%;text-align:left; vertical-align:top;">
    <af:column sortProperty="Comments" sortable="false"
    headerText="Description" id="c65"
    width="847"
    inlineStyle="text-align:left; vertical-align:top;"
    noWrap="false">
    <af:outputText value="#{row.bindings.Comments.inputValue}"
    shortDesc="#{bindings.POC.hints.Comments.tooltip}"
    id="it2" noWrap="false"/>
    </af:column>
    </af:table>
    Thanks

    Hi Frank,
    Following is the jsp code that i am using but not able to wrap the text in column:
    <af:table id="logTable"
    value="#{abc.listWorkBenchLog}"
    var="log"
    bandingInterval="1"
    banding="row"
    rows="5"
    inlineStyle="border: 1px solid Silver ;width:700px;height:100px;overflow:scroll;" >
    <af:column sortable="true" sortProperty="strDesc" width="700" noWrap="false" >
    <f:facet name="header">
    <af:outputText value="Description"/>
    </f:facet>
    <af:outputText value="#{log.strDesc}" />
    </af:column>
    </af:table>
    I tried removing noWrap however it places a horizontal scroll bar (which i dont want and hence implementing this wrap text functionality) in the table.
    please help,
    Manglesh

  • How to wrap text in two columns and display as one in WAD

    Hi ,
    I have the following columns in my ODS , they are not KF's
    c1        c2    c3    
    100      AA      BB
    200      CC      DD   
    I need this display format
    100   AA
          BB
    200   CC
          DD
    I need to wrap the text in columns c2 and c3 and display them under one column.
    Is it possible in  webtemplate by using java scripting.

    IN the Query , you could diplay Characteristics as a Hierarchy. Just above the Columns Box in Bex, do a write click.
    Hope this helps

  • Is there any better way of optimizing memory?

    Hi Friends!
                      I am new to Labview and need some help. In a VI sescibed below I would like to know about optimizing the memory.
    Problem: Needs to take the values of 7 physical quantities for three different time intervals. Each physical quantity has individual elements(which are clusters)  whose number actually depends on the user input ( can be of any number).
    What I have done: I had first constructed an
    1. Array(Let it be array1 for discussion)  of three elements(For three time intervals)  each element is a cluster(Let be Level 1 Cluster)
                    2.Cluster(Level1) has 7 arrays(Let them be Level 2 arrays) to represent 7 physical quantities
                From the concepts of arrays in the C each element of the array occupies same memory space. But does this concept applicable here. As I have elements in a cluster(level1) as arrays(Level 2). Each one of the array(Level2) could be of different size depending on user input.
    If there is another way to handle them please help me with ur valuable suggestion.
    Siddhu.

    I don't quite understand why optimizing memory here is required as the
    data set does not seem very large.  That being said, clusters use
    (relatively) a lot of memory, and nested arrays/clusters are generally
    considered poor programming.  It seems to me that this can be
    handled with a 3D array (much more memory efficient):  3 pages for
    the time intervals, 7 rows for the physical quantities and an
    indeterminite number of columns for the individual elements.  How
    to handle the array depends on what are valid values for the individual
    elements.  If the data type is numeric and 0 is not a valid user
    input value, then it's easy.  Just build the array row by
    row.  Each row will have the number of columns equal to the
    largest number of individual elements entered.  Data that has not
    been entered by the user will be 0.  For example, at time interval
    1:
    PQ1: 9 2 7 4 1 8
    PQ2: 8 7 2
    PQ3: 1
    PQ4: 4 6 8 2
    PQ5: 2 3 4 5 6 7 8
    PQ6: 4 2 7 9
    PQ7: 2 4
    The first page of the array would be:
    9 2 7 4 1 8 0
    8 7 2 0 0 0 0
    1 0 0 0 0 0 0
    4 6 8 2 0 0 0
    2 3 4 5 6 7 8
    4 2 7 9 0 0 0
    2 4 0 0 0 0 0
    If the data type is not numeric or 0 is a valid value, I would
    initialize a 3D array that is 3 X 7 X (something larger than the max #
    of individual elements) with some sort of invalid value.  Then,
    as  the user inputs individual elements, replace the appropriate
    array element.  This also has the advantage of creating the array
    ahead of time so LabVIEW will not have to create any memory buffers.
    Hope this helps.
    Dave.
    ==============================================
    David Kaufman
    LabVIEW Certified Developer
    ==============================================

  • Is there any better way to publish a "read-only" panel on the web

    Hi
    I am new user in Labview. I am trying to publish some of our test result on the web. However. the current methods all have their disadvantages in my application
    .monitor: I like this, but it is only supported by Netscape, which is not do popular anymore. I dont want push our customer to install it just for our demonstration.
    .snap+refresh: Our application requires fairly fast refresh, 1 fresh/sec. the blank in during the refresh does not look nice.
    Embed: I want to demonstration to be read-only, I dont want the custome gain any control over that. Also scroll bar shows in the embed mode is also something I dont want.
    I am using LabView 6.1, if the problem has been solve in new version, I am glad to upgrade. Also is there is other better to meet my requirement, please help me.
    Thanks
    Message Edited by zach DDS on 10-05-2005 12:23 PM

    Sorry, you must have edited your message. When I saw it, only the title showed .
    Embedded is what you want. You can change the windows apperance (e.g. hide the scroll bars) by changing the VI properties.
    Uncheck "request control" in the web publishing wizard, and it will be read only.
    Works fine here in LabVIEW 7.1. I don't remember if 6.1 had any limitations.
    LabVIEW Champion . Do more with less code and in less time .

  • Is there any better way to refresh?

    Hello
    I would like to know if anyone here has a better solution for refreshing components like JPanels. I'm developing an application which uses slow algorithms to draw the points on them. It would be absurd to call these methods again to simply refresh these components (ex: when the user minimizes or resizes the component), just as absurd as it would be to put the slow algorithm code in the paint(Graphics g) method.
    The solution I'm using now is to save the coordinates and attributes of the points the program needs to draw in an array or some other data structure, so that the program can easily call a refresh method (which draws the points from the information store in these arrays).
    But, since I'm using many (slow) algorithms, and since each plot has it's own particularities, I end up creating big refresh methods, even creating classes specifically to refresh components!
    I was wondering if it would be possible to simply copy the image of a component in a given time, so that I could just repaint it on the component whenever it's necessary (i.e, when the component listeners called it). Is it possible?

    I think want you're wanting to do is just a simple double-buffering?
    So, the first time your component is asked to paint itself (you should override paintComponent() rather than paint(), by the way), do this:   private BufferedImage image = null;
       public void paintComponent(Graphics g) {
          if (image == null)
             image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
             Graphics imageG = image.createGraphics();
             // TODO: paint your component onto 'imageG'
          g.drawImage(imageG, 0, 0, null);
       }You may also want to reset 'image' to null if the component changes sizes.

  • Is there any better way of writing this query??

    I have a query on insert which looks like this,
    INSERT INTO TEMP( I1,I2)
    SELECT TI1 FROM CLIENT1
    WHERE R_CD ='PR' OR 'SR',
    SELECT TI2 FROM CLIENT2
    WHERE R_CD = 'MN' OR 'OP
    There are two tables where the source data is coming from and inserted into TEMP table. I find this query to be inefficient. Anybody who can help me writing a good one?? Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by [email protected]:
    I have a query on insert which looks like this,
    INSERT INTO TEMP( I1,I2)
    SELECT TI1 FROM CLIENT1
    WHERE R_CD ='PR' OR 'SR',
    SELECT TI2 FROM CLIENT2
    WHERE R_CD = 'MN' OR 'OP
    There are two tables where the source data is coming from and inserted into TEMP table. I find this query to be inefficient. Anybody who can help me writing a good one?? Thanks.<HR></BLOCKQUOTE>
    A possible solution,
    INSERT INTO TEMP( I1,I2)
    SELECT C1.TI1, C2.TI2
    FROM CLIENT1 C1, CLIENT2 C2
    WHERE (C1.R_CD = 'PR' OR C1.R_CD ='SR') AND
    (C2.R_CD = 'MN' OR C2.R_CD = 'OP')
    null

  • HT4759 is there any better way you can track stolen iphone 5 and iphone 5s rather than find my iphone?

    i have lost iphone 5 and iphone 5s within 4 month, its real sad coz there is no way i can track them, have been using icloud (find my iphone) for all these time but it doesn't show nothing helpful rather than my iphones are offline. i need help on this please.....

    Find my...is the only way to track a device.
    Barry

  • IMAQ Resample performanc​e. Any better choice for 50% downsample​? (average 2x2 - 1 pixel)

    My video source is a 4 Mpixel (2k x 2k resolution) USB3 camera. This is displaying a live image OK in Labview at 45 fps using only 20% CPU.  So far, so good.
    I added a "IMAQ Resample" block to downsize this to 1024 x 1024 image. That works with almost no additional processing time if I select "Zero Order" interpolation (eg. plain subsample to value of nearest pixel). However, I want to average each 2x2 block (4 pixels) in the input image into 1 output pixel. I *think* that is the effect of selecting Bi-Linear interpolation. Doing that works, but takes about 45% of CPU.  I want to do some other processing but am worried I will quickly run out of CPU time and start dropping frames.
    Is there any better way to do this simple 50% downsize (2x2 average), that would take less CPU overhead, or is this the best way?

    Hi jbeale1,
    In NI-MAX (Measurement & Automation Explorer) select your camera. Under the  'Acquistion Attributes' tab do you see an option to change the Video Mode of your camera to a different resolution? If your camera supports it, it would be more efficient to change the resolution there.
    If not , here is a little more info regarding the IMAQ Resample VI:
    http://zone.ni.com/reference/en-XX/help/370281P-01​/imaqvision/imaq_resample/
    You are correct, the Bi-Linear option uses a more intensive interpolation technique which is why it is more taxing on your CPU. I hope this is helpful.
    Robert S.
    Applications Engineer
    National Instruments

  • How to align headline to column, rather than wrapped text

    I have a large text box containing multiple paragraphs aligned to the left. Throughout there are 5 sub heads that need to be centered. There are images that the paragraphs are wrapping to. When I use the Align Center option for the subheads, some are aligned to the entire text box and some are aligned to the center of the wrapped text. (The images do not extend to the subheads, so it is not a situation where the text wrap is forcing the subheads to move) I would like all of the subheads to be consistently in the center of the entire text box - is there an option I am missing?
    Sorry if this is an obvious question, but I appreciate any help!

    This one is using dummy text, but it shows the same issue I am having. You can see where Subhead #2 and #4 are affected by the image text wrap. I know I can use a center tab, but am wondering if there is a way to change the settings to make them center to the entire column.
    (The red dotted line is just to show where that the center line.)
    Thanks!

Maybe you are looking for

  • Iphone 3g Dismiss button stuck. Also no service available. Help?

    This is has been doing my head in! I've just bought this iphone from Ebay, upon turning it on you unlock the screen and it comes up with the whole rearranging icons and whatnot. But the dismiss button is stuck and nothing works! People have come up w

  • Number of Instances of any Object in JVM

    Hello Guys, Is there any way to know number of instances for any perticular class in JVM. For example i want to know how many instance of calss "Vector" are there in JVM. Can we write any program which take class name as parameter and tells the numbe

  • Setting the SOAPaction

    Good Morning All! I am having a little problem setting the SOAP action in my program. I am setting the "SOAPACTION_USE_PROPERTY" and the ?"SOAPACTION_URI_PROPERTY" properties, but they do not seem to be working. An example of the message that is bein

  • On disc editing?

    Hi, newbie here. Sorry if this is obvious, just trying to learn & can't find this in the help docs so thought I'd ask here: I used to do on disc editing with another program and though I knew it was risky, I liked it because I record music performanc

  • Desactivar opciones de  Guardar y guardar como

    Hola amigos tengo un problema me piden que cree un pdf que solo se pueda leer e imprimir y quiero desabilitar la opcion de Guardar y guardar como existe alguna manera???? tengo el acrobat 5 y 6 profesional Muchas gracias SAludos