Multi-line Labels in Swing 1.1?

Hi
Is it possible to get multi-line labels
(using any type of component) prior
to 1.1.1?
Marc

I think you should create a custom table cell renderer. As I am a lazy one I'd subclass a default renderer as follows (I have not tried it, it's just a clue):
public class MultilineTableCellRenderer extends DefaultTableCellRenderer
     private JTextArea renderer;
     public MultilineTableCellRenderer()
          renderer = new JTextArea();
          renderer.setEnabled(false);
          // You should find out another color constant if you are using
          // Java L&F, this works with the Windows L&F.
          renderer.setDisabledTextColor(UIManager.getColor("control"));
     public Component getTableCellRendererComponent(JTable table,
          Object value, boolean isSelected, boolean cellHasFocus, int row,
          int column)
          JComponent compo = (JComponent) super.getTableCellRendererComponent(
               table, value, isSelected, cellHasFocus, row, column);
          renderer.setBackground(compo.getBackground());
          renderer.setForeground(compo.getForeground());
          renderer.setDisabledTextColor(compo.getForeground());
          renderer.setBorder(compo.getBorder());
          // Might need something like that.
          /* renderer.setText(value.toString() ???); */
          return renderer;
}You might want to stub out methods like repaint, validate for better performance in a JTextArea subclass...
Kurta

Similar Messages

  • Accordion multi-line label

    I'm trying to figure out how to make the label in my
    accordion multi line - I can't seem to figure it w/ styles. I could
    probably do it w/ html text.. but if there's an easier way. I'm
    wondering why can't I just drill down to the text label in the
    component and edit?? I read that Text Control will do multi-line
    but how the heck to I get that into this accordion?
    Can anybody please help me get on the right path. Is this
    going to involve code to equate the text label with a text field?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Accordion x="382" y="126" width="400"
    height="400">
    <mx:Canvas label="Accordion Pane 1" width="421"
    height="450">
    </mx:Canvas>
    <mx:Tile label="This is an example of a multiline text
    string in a Text control." width="100%" height="100%"
    fontFamily="Georgia" fontSize="26"
    color="#8080ff"></mx:Tile>
    </mx:Accordion>
    </mx:Application>

    I didn't try his example and didn't clearly see if the text gets cut or not.
    Well, fact is that my Label shows the whole text (I didn't mentioned this before, did I?)
    Well, I have uploaded it here: [http://79.170.44.105/lyrion.ch/concept.htm|http://79.170.44.105/lyrion.ch/concept.htm]

  • Multi-line Label inside VBox gets overlapped

    I don't know if it's a bug or a "feature", but I have something like the following:
    VBox {
            content: bind [Label,
            Hyperlink]
    }The text inside the label has a line break in it. Now the problem is that the layout manager ignores the fact that a multiline-text increases the label size and places the hyperlink at the place it would normally be if the label would only have one line of text.
    Any ideas for a clean workaround? Is this a bug?

    I didn't try his example and didn't clearly see if the text gets cut or not.
    Well, fact is that my Label shows the whole text (I didn't mentioned this before, did I?)
    Well, I have uploaded it here: [http://79.170.44.105/lyrion.ch/concept.htm|http://79.170.44.105/lyrion.ch/concept.htm]

  • Multi Line Menu Item and Button

    Dear oracle developers,
    I am trying to set a multi line label for
    a button.
    The label should be displayed as
    Client
    Reports rather than Client Reports
    on the screen.
    I tried CHR(i) for all the 255 ascii numbers.
    I get some special characters inbetween but never got a new line.
    Can any one have some ideas about this. I would like to use the same feature for a menu item also.
    Thank You.
    Srini S. Sundar

    Hi,
    U can do this in the following way :
    1. Create a Icon button in your Forms canvas.
    2. create a icon file (.ico) by writing a multiline text.
    3. Attach this .ico file to the icon button in your forms.
    Hope this may help you.
    sandip.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Srini Sundar:
    Dear oracle developers,
    I am trying to set a multi line label for
    a button.
    The label should be displayed as
    Client
    Reports rather than Client Reports
    on the screen.
    I tried CHR(i) for all the 255 ascii numbers.
    I get some special characters inbetween but never got a new line.
    Can any one have some ideas about this. I would like to use the same feature for a menu item also.
    Thank You.
    Srini S. Sundar<HR></BLOCKQUOTE>
    null

  • Multi-line toggle button bar labels?

    I am trying to do a grid of buttons where only one button in a row can be "pressed".  Seems, based on suggestions here as well, the easiest way is one togglebuttonbar per row of a grid.
    Anyway, I need to have taller buttons with a few lines of text in each label (button).  Think of a table where the cells are selectable.
    I found a way to extend a simple button's label to make it multi-line, but not sure on how to do this for a togglebuttonbar:
    package tools
    import flash.text.TextFieldAutoSize;
    import mx.controls.Button;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class MultilineButton extends Button {
    public function MultilineButton()
    {super();}
    override protected function createChildren():void
    super.createChildren();
    textField.multiline = true;
    textField.wordWrap = true;
    textField.autoSize = TextFieldAutoSize.LEFT;
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    textField.y = (this.height-textField.height)>>1;
    And then I call it with <t:MultilineButton label="four score and seven years ago" width="150" height="150" textAlign="left"/>
    Should I just use this single button in a Repeater?  Or is there a way to work with the togglebuttonbar?

    I tried that, I guess I am doing it wrong since it is still doing centered
    and bold:
    package tools
    import flash.text.*;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class MultilineToggleButtonBar extends ToggleButtonBar
    public function MultilineToggleButtonBar()
    super();
    override protected function createChildren():void
    super.createChildren();
    textField.multiline = true;
    textField.wordWrap = true;
    textField.autoSize = TextFieldAutoSize.LEFT;
    var format:TextFormat = new TextFormat();
    format.bold = false;
    format.align = "left";
    textField.defaultTextFormat = format;
    override protected function updateDisplayList(unscaledWidth:Number,
    unscaledHeight:Number):void {
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    textField.y = (this.height-textField.height)>>1;

  • Address Book: Importing Multi-Line Fields

    A common and often unavoidable import format for Mac Address Book is Comma Separated Value files (.csv). Address Book cannot import CSV files that have multi-line fields, such as might be included in Notes, because it cannot tolerate embedded newline characters (a.k.a., carriage returns, line breaks). (See http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad808.html. The CSV spec (http://en.wikipedia.org/wiki/Comma-separated_values) addresses this need by requiring that fields which contain newlines be enclosed in quotes, but Address Book doesn't adhere to this part of the standard.)
    Here's a way to import CSV files and have multi-line fields preserved:
    Using an editor, replace +every embedded+ newline character in the CSV file with "\n". Take care to not alter the newline characters that end each record. Import the resulting file into Address Book using the CSV option. Selecting the 'Last Import' group, export those specific records using the vCard option. Then delete those records. Then import the vCards previously exported. Presto!
    Apparently, although Address Book is blind to "\n" when importing CSV files, and exporting vCard fields, it interprets this character sequence as newline when importing vCards.

    Hi Adam,
    Thanks, but the problem is not importing to AddressBook, it is exporting.  I did discover from another that I can export very easily to a Numbers spreedsheet.  It is exceptionally simple.  But it will not export custom fields.  Someone said that is because of a vcard standard.  My custom fields are just "name" fields that I have labeled differently.  But Numbers does not support the name (it only takes the name of the card).
    Christine

  • Print JTable with multi line header

    I need to print a JTable with multi line header, I want to know if I can use the method jTable.print(int, MessajeFormat, MessageFormat) by manipulation of the MessageFormat. How I can manipulate it?
    Otherwise, How I can print this?

    hi again,
    To print pdf in a swing application you don't need servlet.jar.
    You'll only need itext.jar and a printer connected to your pc.
    Download the iText source code and unzip it. See the following classes:
    com.lowagie.tools.LPR and com.lowagie.tools.BuildTutorial. This latter is the main class of a swing tool that you can run.
    Silent Print:
    You have only to embed this javascript code in your pdf:
    writer.addJavaScript("this.print(false);", false);
                        document.add(new Chunk("Silent Auto Print"));Then, you have to send the document to the printer.
    Google : java print pdf
    http://forum.java.sun.com/thread.jspa?threadID=523898 or
    http://www.exampledepot.com/egs/javax.print/pkg.html for printing task.
    Under unix system, I used this:
                           String PRINTER = ...;
                   try {
                        String cmd = "lp -d " + PRINTER + " " + PDF_PATH;
                        Runtime.getRuntime().exec(new String[] { "sh", "-c", cmd });
                   } catch (Exception e) {
                                 //handle the exception
                                 e.printStackTrace();
                   }hth

  • Multi line dialog box

    I am using my first java bean in an oracle forms application.
    The bean creates a dialog box via :
    sReturn = JOptionPane.showInputDialog(null, text, title, icon);
    My problem is that i am trying to have the user enter a multi line address and ctrl_Enter , tab and enter keys all close the dialog box at the end of the fist line.
    How do i provide for multi-lines?
    Thanks

    Swing related questions should be posted in the Swing forum.
    Read the Tech Tip on [url http://java.sun.com/developer/TechTips/index.html]Beyond The Basics of JOptionPane. You can add any component to the Option Pane, so add a JTextArea.

  • How do you display multi line text

    Hi
    How does one display multi line text? I would like to display address information on the screen so that the user can select it and copy/paste it into another application (ms word).
    I have the address information as separate columns (address1, address2, city, province, postal code) so I've changed the query on my view object to add it as address1 || chr(10) || address2 || chr(10) || city ....
    If I display it on the page as an output text, it all displays as one line (okay, the chr(10) thing did not work but that's beside the point).
    In general, is there a way to display multi line text? What component is suitable for this, if there is one?
    Thanks

    You can use normal outputText components in a panelGroupLayout (vertical layout) and add each attribute to it. The remove the labels or set the components to simple. You can then mark the data in the browser and use normal copy&paste to transfer the data.
    If you want to output longer text with line breaks you can use an outputText with escape=false and use the br html tag to generate a line break;
    <af:outputText escape="false"
    value="+++++++long<br>test<br> this is a long text in multiple lines" id="ot10" truncateAt="#{viewScope.ToggleBean.truncateLength}"/>Timo

  • Permanently save line spacing in a multi-line text field

    Me: Adobe Acrobat 8 Pro, Windows Vista
    (I think the people who will be using the form have Reader 7 on Windows)
    I work in a doctors' clinic, and we use phone message sheets to document conversations between the patients/us/nurses/doctors, and I scanned the form and made it into a fillable PDF for our secretaries to fill out more quickly. The "message" area has pre-printed lines on it, and the multi-line text field I placed there needs to match up to the lines. I used the Rich Text Formatting options to set it to "Exactly 24 Points," but I can't get it to KEEP the formatting permanently. The only way I could get it to save the formatting in that field was to put a space in it and then save it, and then give that to the 2 phone secretaries. It works perfectly the first time, but instead of just closing/re-opening the file to start a new message, one of the secretaries highlights everything in the "message" field and deletes it... which deletes the line spacing formatting. I've told her
    b numerous
    times to leave that starting space in the field, but she "forgets" so all of her messages look messed up. So is there a way to force that line spacing
    b PERMANENTLY
    ???? Here's a shrunken screenshot of the field -- I wish I could just erase the lines altogether so the spacing wouldn't matter, but the secretaries type/print the message out, then the nurses/docs write on the page with pen so the lines have to stay. http://img187.imageshack.us/my.php?image=notepreviewph8.jpg
    Thanks!

    You can set the font size of the text. Then play with the underlines in the original document to match the needs of the font that is used. Print to a new PDF and then use replace pages to put the new page into the form without changing the form fields. I was able to do this with a word processing document by adding underlining in the document with 12 pt and setting the font to 12 pt in the text field. You can play with the font, the border of the field, and the underlining in the original document to get the desired result. Is this optimal, probably not. However it does the job.

  • Multi Line Text Custom Field

    Multi line text custom field is not coming in ms project Professional

    Pradeep,
    You cannot access Multiline text fields from Project Professional and in Project Server Views. These fields are for use in Project Details pages and with workflow for demand management in Project Server. Please refer to the article shared in earlier post.
    I would recommend you to create a Excel/SSRS report if you would like to show data available in this fields to end users.
    Hope this helps.
    ===================================================
    Thank you,
    Kiran K.
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

  • Need a JavaScript to enable/view Multi-line option for Text fields.

    Hello All,
    I need a JavaScript to enable/view Multi-line option for all the Text fields in PDF Form.
    Assume that I have a PDF form of Fields from F1 to F100 and it contains 25 Checkboxes, 25 Combo Box and 50 Text Fields. Now i need a javascript for which i need to enable Multiline for only Text Fields. So Is there any JS for which i can enable the Multiline option for only Text fields and not for ComboBox or Checkbox.

    Hi timo,
    Thanks for your help. iam trying to use the iteraor approch to do this. but i don't know how to fetch the data entered in the form that was built by the iterator. can you please tell me .
    thanks

  • How to Remove the /Div in a Multi-line Field when reporting in Excel, getting

    I am uisng Excel Services to extract data from PS2013.  And the Multi-line text fields include the </Div> syntax.  I have looked at a lot of the links regarding how to do this.  I have even borrowed code that was on someones blog. 
    When I try and use it I get the following message and cannot not seem to resolve it after reading varous links regarding this issue. 
    Any ideas?  As a work around I have created an Excel Macro to remove it, however would like to solve it in the query
    Error Message
    The data types
    Nvarchar and Ntext are incompatible in the add operator
    Here is the syntax
    declare @Headxml nvarchar(350)
    declare @Footxml nvarchar(50)
    set @Headxml = N'<?xml version="1.0"?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"
    [<!ENTITY  nbsp "&#xA0;"><!ENTITY quot "&#x22;">]><html><body>'
    set @Footxml = N'</body></html>'
    SELECT   ProjectOwner.ProjectUID as [ProjectUID],
    ProjectOwner.ProjectName as [Project Name],
    ProjectOwner.[Project Number] as [ECP#],
    TaskRelated.TaskName as [Task Name],
    MSP_WssRiskToTaskLinks_UserView.RiskID as [Risk ID],
    MSP_WssRiskToTaskLinks_UserView.Title as [Risk Title],
    MSP_WssRiskToTaskLinks_UserView.Status as [Status],   
    MSP_WssRiskToTaskLinks_UserView.AssignedToResource as [Assigned To],
    MSP_WssRiskToTaskLinks_UserView.Owner as [PM], 
    MSP_WssRiskToTaskLinks_UserView.DueDate as [Due Date],  
    MSP_WssRiskToTaskLinks_UserView.Probability as [Probability],
    MSP_WssRiskToTaskLinks_UserView.Impact as [Impact], 
    MSP_WssRiskToTaskLinks_UserView.Exposure as [Exposure],
    MSP_WssRiskToTaskLinks_UserView.Cost as [Cost],
    MSP_WssRiskToTaskLinks_UserView.CostExposure as [Cost Exposure],  
    MSP_WssRiskToTaskLinks_UserView.Category as [Category],
    ISNULL(LTRIM((CONVERT(xml,(@Headxml+MSP_WssRiskToTaskLinks_UserView.[Description]+@Footxml),3)
            .value(N'(/)','nvarchar(4000)'))),'') AS [YourMulti-lineCustomFieldNewName],
    MSP_WssRiskToTaskLinks_UserView.MitigationPlan as [Mitigation Plan],  
    MSP_WssRiskToTaskLinks_UserView.ContingencyPlan as [Contingency Plan],
    MSP_WssRiskToTaskLinks_UserView.TriggerTask as [Trigger Task],
    MSP_WssRiskToTaskLinks_UserView.TriggerDescription as [Trigger Description],
    MSP_WssRiskToTaskLinks_UserView.CreatedDate as [Created Date],
    MSP_WssRiskToTaskLinks_UserView.CreateByResource as [Create By],
    MSP_WssRiskToTaskLinks_UserView.ModifiedByResource as [Modified By],
    MSP_WssRiskToTaskLinks_UserView.ModifiedDate as [Modified],
    TaskRelated.TaskUID as [TaskUID],
    TaskRelated.TaskName as [Task Name],
    TaskRelated.TaskStartDate as [Task Start],
    TaskRelated.TaskFinishDate as [Task Finish] FROM dbo.MSP_WssRiskToTaskLinks_UserView
    LEFT OUTER JOIN dbo.MSP_EpmProject_UserView AS ProjectOwner ON ProjectOwner.ProjectUID = MSP_WssRiskToTaskLinks_UserView.ProjectUID
    LEFT OUTER JOIN dbo.MSP_EpmProject_UserView AS ProjectRelated ON ProjectRelated.ProjectUID = MSP_WssRiskToTaskLinks_UserView.RelatedProjectUID
    LEFT OUTER JOIN dbo.MSP_EpmTask_UserView AS TaskRelated ON TaskRelated.ProjectUID = MSP_WssRiskToTaskLinks_UserView.RelatedProjectUID 
    AND TaskRelated.TaskUID = MSP_WssRiskToTaskLinks_UserView.RelatedTaskUID LEFT JOIN dbo.MSP_WssRelationshipType ON
    MSP_WssRiskToTaskLinks_UserView.RelationshipTypeID = MSP_WssRelationshipType.RelationshipTypeID                
    ORDER BY ProjectOwner.ProjectName ASC,  MSP_WssRiskToTaskLinks_UserView.RiskID
    Andrew Payze

    Hi Andrew,
    We normally create a function to do this. Some examples can be found here:
    http://blog.sqlauthority.com/2007/06/16/sql-server-udf-user-defined-function-to-strip-html-parse-html-no-regular-expression/
    http://lazycoders.blogspot.co.uk/2007/06/stripping-html-from-text-in-sql-server.html
    http://stackoverflow.com/questions/457701/best-way-to-strip-html-tags-from-a-string-in-sql-server
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Update of Qty in multi line PO's

    Hi All,
    We need to update the qty in the PO (multi line POs), and we have around 3000 multi line POs, please let me know which is best way to change the qy in these POs.
    Please let me know complete process.
    thnks
    Vihaan

    Hi,
    I would create a program calling BAPI_PO_CHANGE for each PO item and update the quantity.
    Regards,
    Gilberto Li

  • Multi line issue in Table Cell Editor

    Hi,
    I am developing an occasionally connected application for handheld devices using NetWeaver Mobile 7.1. In one of the view, I have a table which display items information from the data source. In one of the column I need to display item description so I used TextEdit in the Cell Editor to display the information in multi line format and also wrapping is enabled.
    But during testing of the application the TextEdit control does not wraps the text and as well as only first line of TextEdit control is visible inside the table and rest of the rows are not visible because of table's row height is not adjusted to the TextEdit control. I couldn't find any option to vary the size of the row height of the table.
    Please suggest a solution to bring multi line display with in the table.
    Also, check out my other issue posted here.
    [Issue in wrapping of text in TextEdit control|Issue in wrapping of text in TextEdit control]
    Thanks in advance.
    Regards,
    DVR.
    Edited by: Vinodh Raj D on May 28, 2009 8:18 AM

    Hi Vinodh,
                   Mutliline text in a text view/edit control inside a table cell is not supported.
    You can view multiline text in a text view/edit as a seperate control inside a view. I think in case you want to see the whole address you can create a detail(s) view which can be navigated from the list (table) view.
    Regards,
    Nipun

Maybe you are looking for

  • 6.40 Ramp-Up: Dispatcher problem

    Hi, we have installed the WAS 6.40 unicode version (ABAP + Java) and Adobe Document Services as part of the Ramp Up. The installation was done successfully without any problems and Support Packages (ABAP, BASIS) have been applied up to level 3, in ad

  • RME Fireface 800 in 64 bit Problem

    Using information helpfully provided by Kappy and The Hatter on this forum (see topic https://discussions.apple.com/message/27751034?ac_cid=op123456 if interested) I found that I was able to get my Mac Pro (early 2008) 3,1 to boot in 64 bit mode, and

  • Discoverer 11g certification with JRE 1.7

    Hello, Oracle Support Note 1469683.1 "Discoverer 11g With Java 1.7 (JDK or JRE) Fails With Exceptions" states that Discoverer 11.1.1.6 is certified with Java 1.7 when using Weblogic 10.3.6. It indicates that this information can be found in the certi

  • 2560 x 1600 at 30 Hz from Mac mini

    Can the Mac mini Core2Duo output 2560 x 1600 at 30Hz so I can drive a 30" display at full resolution with a SingleLink connection? If the Mac mini Core2Duo can't, can a Mac mini G4 (with the ATI 9200) do it? Is there something like SwitchResX that wo

  • Reg: Weblogic handling of poison messages

    Hi I am using a j2ee application in weblogic 10.3.1 listening to MQ Queue using jms bindings created through jms admin Now my requirement is , when there is an exception in the application due to any resource like DB ,(Exception is thrown causing bac