Create a Multiple-Line JButton Without Using HTML format

I used html format for multiple-line JButton and it took a long time to load that button up (about 5 seconds more). Does anyone know how to create a multiple-line JButton without using html?
Any suggestion or sample code will be appreciated.
javamesser

Hello,
You could try using the following:
-give your button some layout (e.g.: BoxLayout.Y_AXIS, or BorderLayout).
-create the wrapped text in separate JLabels (one line in each label)
-add your labels to the button
Advantage:
this solution does not affect the laf classes
Disadvantage:
focus rectangle is not calculated accurately
Regards,
G

Similar Messages

  • How to create a multiple line label?

    Hi,
    I need to set a multiple line label. If I enter the following code:
    strTitle = "<html><body><b><font color=red>The first line,<br>";
    strTitle = strTitle + "the second line.</font></b></body></html>";
    jLabelTitle.setText( strTitle );
    I can see a two line label. However, with such code, if I go to the UI editor for that frame, the jdev immediately crashed. I am using jdev 9i_902. If I go to UI editor for any other frames without such code, everything is fine, no problem at all.
    Can anybody explain why? Is there other way to create a multiple line label?
    Thanks!
    Harvey

    Harvey - I have reproduced this in the production and the latest build. I have logged bug 2446385 but have found a work around. If
    you code:
    strTitle = "<html><body><b><font color=red>The first line,<br>"+"the second line.</font></b></body></html>";
    jLabel1.setText(strTitle);
    It seems to work ok.
    Hpoe this helps and thanks for posting this.
    Regards
    Grant Ronald
    Product Management

  • How do I create a webpage in Dreamweaver WITHOUT using layers?

    I'm reading a lot about how we should not use layers and
    tables when creating a website in Dreamweaver because of something
    called "absolute placement" (or something), which is the reason the
    text in my website is constantly misaligned or overlapping when
    opened up in Firefox. Although, I've never had this problem before
    for the past three years I've been using Dreamweaver to create my
    sites, which is what's most frustrating I think.
    So, I guess I'm wondering how, then, do I create a webpage in
    Dreamweaver WITHOUT using layers and tables? The only thing I've
    been able to do w/o layers/tables is to literally hit "enter" and
    "tab" continuously until the cursor is somewhere close to where I
    want it to be on the page. But that seems a little old-school (for
    lack of a better term) to really be the way to do it.
    Also, if I've used a lot of layers/tables already in my
    website, is the general recommendation for be to rebuild my site
    completely w/o layers/tables, or is it feasible for me to have
    someone who knows HTML just come in and fix the actual HTML code
    for me to make it all work?
    Ideally, I just want something to help me fix this problem
    w/o having to hire someone else to come in, cause I've been working
    this site for about a year now and am just now finally getting it
    up online only to find that the way it looks online is not the way
    it looks in Dreamweaver. I'd really really appreciate any
    suggestions/advice.
    Thank you so much!

    Hello,
    The first bit of advice, which you may already be doing, it
    to learn HTML
    and CSS.
    CSS is used to style and position elements.
    Instead of adding numerous   to add spacing, for
    example, you can use
    CSS to add margins or padding to elements to move them away
    from other
    elements.
    Also, IMHO there is nothing wrong with using tables,
    specially as you learn.
    You can also use <divs> and CSS to position them (a
    table-less layout).
    There are a number of threads in this forum comparing them
    and giving many
    designer's views.
    It's Dreamweaver's "Layout Mode" you should stay away
    from.Use "Standard
    Mode"
    It creates tables with rowspanss and colspans that are very
    fragile.
    Something as simple as a user having a different text size
    setting in their
    browser than what you had in yours when you designed can make
    the page break
    apart.
    More info:
    http://apptools.com/rants/spans.php
    Also, "Layers" are an older DW term for AP Divs (Absolutely
    Positioned).
    They can cause you a lot of frustration.
    More info:
    http://apptools.com:80/examples/pagelayout101.php
    I would strongly suggest you take a couple of hours to do
    these tutorials.
    They are a great introduction to using CSS, making a
    stylesheet and using
    DW's "wizards".
    They are very well written, illustrated and easy to follow.
    I promise you will walk away with a different outlook on how
    you can design
    a page.
    They are not intended to replace learning HTML or CSS in any
    way, I just
    think it will benefit you greatly seeing what you can do.
    http://projectseven.com/tutorials/css/css_td/index.htm
    http://projectseven.com/tutorials/css/qdmacfly/index.htm
    I hope that helps.
    Take care,
    Tim
    "darkpwca" <[email protected]> wrote in
    message
    news:[email protected]...
    > I'm reading a lot about how we should not use layers and
    tables when
    > creating a
    > website in Dreamweaver because of something called
    "absolute placement"
    > (or
    > something), which is the reason the text in my website
    is constantly
    > misaligned
    > or overlapping when opened up in Firefox. Although, I've
    never had this
    > problem
    > before for the past three years I've been using
    Dreamweaver to create my
    > sites,
    > which is what's most frustrating I think.
    >
    > So, I guess I'm wondering how, then, do I create a
    webpage in Dreamweaver
    > WITHOUT using layers and tables? The only thing I've
    been able to do w/o
    > layers/tables is to literally hit "enter" and "tab"
    continuously until the
    > cursor is somewhere close to where I want it to be on
    the page. But that
    > seems
    > a little old-school (for lack of a better term) to
    really be the way to do
    > it.
    >
    > Also, if I've used a lot of layers/tables already in my
    website, is the
    > general recommendation for be to rebuild my site
    completely w/o
    > layers/tables,
    > or is it feasible for me to have someone who knows HTML
    just come in and
    > fix
    > the actual HTML code for me to make it all work?
    >
    > Ideally, I just want something to help me fix this
    problem w/o having to
    > hire
    > someone else to come in, cause I've been working this
    site for about a
    > year now
    > and am just now finally getting it up online only to
    find that the way it
    > looks
    > online is not the way it looks in Dreamweaver. I'd
    really really
    > appreciate any
    > suggestions/advice.
    >
    > Thank you so much!
    >

  • Is it possible to create a DVD in iDVD without using the themes they provide?

    Is it possible to create a DVD in iDVD without using the themes they provide?

    Hi
    No Menu DVD
    from. Mishmunken
    How to create a DVD in iDVD6 without menu (there are several options)
    1. Easy. Drop your iMovie in the auto-play box in iDVD's Map View, then set your auto-play item (your movie) to loop continuously.
    Disadvantage. The DVD plays until you hit stop on the remote
    2. Still easy. If you don't want your (auto-play) movie to loop, you can create a black theme by replacing the background of a static theme with a black background and no content in the drop-zone (text needs to be black as well).
    Disadvantage. The menu is still there and will play after the movie. You don't see it, but your disc keeps spinning in the player.
    3. Still quite easy but takes more time. Export the iMovie to DV tape, and then re-import using One-Step DVD.
    Disadvantage. One-Step DVD creation has been known to be not 100% reliable.
    4. (My preferred method) Easy enough but needs 3rd party software. Toast lets you burn your iMovie to DVD without menu - just drag the iMovie project to the Toast Window and click burn.
    Disadvantage. you'll need to spend some extra $$ for the software. In Toast, you just drop the iMovie project on the Window and click Burn.
    5. The "hard way". Post-production with myDVDedit (free-ware)
    Tools necessary. myDVDedit ( www.mydvdedit.com )
    • create a disc image of your iDVD project, then double-click to mount it.
    • Extract the VIDEO_TS and AUDIO_TS folders to a location of your choice. select the VIDEO_TS folder and hit Cmd + I to open the Inspector window
    • Set permissions to "read & write" and include all enclosed items; Ignore the warning.
    • Open the VIDEO_TS folder with myDVDedit. You'll find all items enclosed in your DVD in the left hand panel.
    • Select the menu (usually named VTS Menu) and delete it
    • Choose from the menu File > Test with DVD Player to see if your DVD behaves as planned. If it works save and close myDVDedit.
    • Before burning the folders to Video DVD, set permissions back to "read only", then create a disc image burnable with Disc Utility from a VIDEO_TS folder using Laine D. Lee's DVD Imager.
    //lonestar.utsa.edu/llee/applescript/dvdimager.html
    hope this helps!
    From LynnLU USA
    www.mediasoftmac.com/dvd-creator-articles/convert-mov-video-to-dvd-on-mac.html#1 29
    Yours Bengt W

  • How to create a multiple-line TextBox in a jfx script?

    How to create a multiple-line TextBox in a jfx script?
    Or
    How to use the Swing component JTextArea in a jfx script?
    Please post a brief code segment.
    Thanks,
    Asghar

    This supports two way binding between JavaFX and Java and also cut and paste.
    Enjoy.
      * MyTextArea.fx
      * Created on Dec 14, 2008, 7:23:49 AM
    package twifxer.components;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.Font;
    import javafx.ext.swing.SwingComponent;
    import javax.swing.JComponent;
    import javax.swing.JTextArea;
    import java.awt.Color;
      * @author Steven Herod
    public class TweetTextComponent extends SwingComponent{
         var myComponent: JTextArea;
         public var length: Integer;
         public var readText:String;
         public var text: String on replace{
             myComponent.setText(text);
         public var toolTipText: String on replace{
             myComponent.setToolTipText(toolTipText);
         public override function createJComponent():JComponent{
             translateX = 15;
             translateY = 5;
             var f:Font = new Font("sanserif",Font.PLAIN, 11);
             myComponent = new JTextArea(4, 33);
             myComponent.setOpaque(false);
             myComponent.setFont(f);
             myComponent.setWrapStyleWord(true);
             myComponent.setLineWrap(true);
             myComponent.addKeyListener( KeyListener{
                 public override function
                 keyPressed(keyEvent:KeyEvent) {
                     if (keyEvent.VK_PASTE == keyEvent.getKeyCode())
                         myComponent.paste();
                 public override function
                 keyReleased( keyEvent:KeyEvent) {
                     var pos = myComponent.getCaretPosition();
                     text = myComponent.getText();
                     myComponent.setCaretPosition(pos);
                 public override function
                 keyTyped(keyEvent:KeyEvent) {
                     length = myComponent.getDocument().getLength();
             return myComponent;
    }

  • How to create new Custom XML Report without using Form Builder

    Hi,
    What are the steps to create new Custom XML Report without using Report Builder ?
    Thanks and Regards,
    Abhi

    Hi,
    Steps we now follow
    1)Create Data Model in Reports Builder
    2)Create xml
    3)Insert xml in Publisher to build Fomat
    4)FTp rdf
    5)Create Data Definition and Template
    6)Create executable and Concurrent Program
    Is there any way we can build reports without use of Report Builder ? By writing PL SQL Package for Before Report and After Report etc ...
    Thanks and Regards,
    Abhijit Rode

  • Is there a way to send and receive SMS on multiple cellular devices without using iMessage?

    I currently own a cellular iPad mini and an iPhone 4s and would like SMS to be the same on both devices as well as my desktop.
    After many months of struggling with iMessage, I decided to turn it off entirely.  I discovered that my best friend did not receive dozens of my texts over the span of a few months (I compared our message history side by side).  Seems like it had something to do with traveling in and out of wifi zones or possibly conflicts between our two carriers, ATT and Verizon.  Regardless, I am not willing to dive into iMessage fully until this gets sorted out.  Further, SMS is the standard message format for everyone outside of the Apple sphere, and I do not feel comfortable lumping them together into one app.  If I decide to switch to Android, will all of my contacts with iPhones continue sending me iMessages?
    Thank you for your help!

    Is there a way to send and receive SMS on multiple cellular devices without using iMessage?
    Search the iTunes App Store for any 3rd party SMS apps that may be available.
    If I decide to switch to Android, will all of my contacts with iPhones continue sending me iMessages?
    Android phones don't receive iMessages, they can recieve SMS messages sent through the iOS Messages app. The app that your contacts choose to use to send you messages is completely up to them.

  • How to create a muli line text area using JavaFx

    Hi all,
    Since the preview SDK does not contain TextArea any more, I am wondering how to create a muli line text area using JavaFX. The behaviour of this text area/field should be somehow similar to JTextArea in Swing or StyledTextWidget in SWT.
    Does JavaFX have any support for this? What would be a sensible approach to create such a widget?
    Thanks for your suggestions,
    br michael

    This is a pretty old thread (I know I came across this while searching for something similar recently), but I figured I'd throw this out there in case other people might find this useful. As I write this, JavaFX's latest version is 1.3... which may have added the needed functionality since the last post.
    You can now create a multi-line text area using a TextBox and by specifying the nubmer of lines and setting the "multiline" value to true. It may not offer all of the same functionality as JTextArea, but it did the job for what I needed... newlines by pressing enter, scrollbar if text surpasses height, etc.
    Here's a simple example:
    Group {
       content: [
          TextBox {
             text: "This is a multi-line textbox"
             lines: 10  // <-- this may/may not be necessary depending on your situation. Default is 5.
             multiline: true
    }Edited by: loeschg on Jul 29, 2010 2:59 PM

  • I have all my pictures in an external drive, how do i create a library in iphoto without using my internal drive space?

    i have all my pictures in an external drive (around 1tb), how do i create a library in iphoto without using my internal drive space? thanks!

    In iPhoto use the command "File > Switch to Library" and then click "Create New" in the Library Chooser panel.
    Select a folder on your external drive as the destination.
    You can also get to this panel by holding down the alt/options key when you launch iPhoto.

  • How to create an instance for RemoteSession without using create() method

    How to create an instance for RemoteSession without using create() method?

    What's RemoteSession? Not in the JDK. And does the question have anything to do with concurrency?

  • Is there anyway to have multiple signature blocks without using an app?  Will IOS 5 have that functionality?

    Is there anyway to have multiple signature blocks without using an app?  Will IOS 5 have that function?

    "No" and "We don't know yet"

  • Outlook 2010 - Always reply using HTML Format Option???

    Hey Guys,
    Have had a good look through the outlook 2010 options but can't find anywhere the option you had in previous outlook versions to set always reply using HTML format email as your default reply type.
    You can open the email and go to the "Format Text" tab and Select "HTML" but I was looking for a permenant way of setting HTML.
    Thanks for any help you can give,
    Thomas

    A couple of things spring to mind.
    If you click the Reply button then delete the TO address and type a different one that's not really a reply. You are effectively Forwarding the message (to another person) and changing its format to suit that other person. Perhaps you
    could investigate adding a custom button that does these two actions with one click.
    Your bug system started the email in Plain Text, probably because it isn't configured for or can't handle HTML mail. Perhaps you could investigate if it can be configured to use HTML format or changed for a system that can.
    You don't have to copy and paste your HTML signature. After you change to HTML format, just click Insert | Signature again and any Plain Text signature should be replaced by an HTML one. (Outlook 2007 and 2010 certainly do this as they know where the signature
    is. I seem to remember that 2003 and before add an HTML signature to the message so you have to delete any existing Plain Text one and/or move the HTML signature to the right place in the message.) This is assuming you have Outlook add a signature to all messages
    as they are created. If you don't then there is no signature to change on the message. You just add the signature after changing format.
    I fully accept that there are valid reasons for wanting to force Outlook to use HTML format
    in certain circumstances but it will not be the right thing to do 100% of the time and if you do so you risk the message you send being unreadable at the other end. For this reason Outlook makes the change of format a manual task. It could, in future,
    make it easier or help you decide when it is appropriate. We will have to wait and see what transpires in Office '15' which should be going to public beta in the next couple of months.
    Simon Jones
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to
    "Mark as Answer". This will help other people find answers to their problems more quickly.

  • How to create a view to display Multiple lines of Text using ABAP WebDynpro

    Hi,
    I need to create a static view page in ABAP WebDynpro that displays Static text data in multiple paragraphs. I tried to use textview, formatted text, text edit controls by binding the textcontrol to a text object that is created in so10, but the output I am getting is only one line and the character count is limited to 60 to 65 characters.
    I would like to know which control needs to be used in ABAP Webdynpro to get multiple lines displayed with text formatting like Paragraph, Indenting and Size.....
    Thanks for your time!
    Madhavi.

    Find the sample codes:
      data sapscript_lines     type tlinetab.
      data sapscript_lines1     type tlinetab.
      data sapscript_tline     type tline.
      data sapscript_head      type thead.
      data text                type string.
      data formatted_text type ref to cl_wd_formatted_text.
      call function 'DOCU_GET'
        EXPORTING
          id                = 'TX'
          langu             = 'D' "Germany language
          object            = 'WDR_TEST_HELP_EXP1'
        IMPORTING
          head              = sapscript_head
        TABLES
          line              = sapscript_lines
        EXCEPTIONS
          no_docu_on_screen = 1
          no_docu_self_def  = 2
          no_docu_temp      = 3
          ret_code          = 4
          others            = 5.
      if sy-subrc <> 0.
        text = space.
      endif.
      formatted_text = cl_wd_formatted_text=>create_from_sapscript(
        sapscript_head  = sapscript_head
        sapscript_lines = sapscript_lines
      " set it into the context
      if Not ( formatted_text is initial ).
        wd_context->set_attribute(
        name  = 'FORMATTED'
        value = formatted_text->m_xml_text ).
      endif.
    clear sapscript_head.
    clear sapscript_lines.
    *Get the text created by SO10
    CALL FUNCTION 'READ_TEXT_INLINE'
      EXPORTING
        ID                    = 'ST'
        INLINE_COUNT          = 1
        LANGUAGE              = 'E' "English language
        NAME                  = '85XX_FOOTER'
        OBJECT                = 'TEXT'
      LOCAL_CAT             = ' '
    IMPORTING
       HEADER                = sapscript_head
      TABLES
        INLINES               = sapscript_lines1
        LINES                 = sapscript_lines
    EXCEPTIONS
      ID                    = 1
      LANGUAGE              = 2
      NAME                  = 3
      NOT_FOUND             = 4
      OBJECT                = 5
      REFERENCE_CHECK       = 6
      OTHERS                = 7
      formatted_text = cl_wd_formatted_text=>create_from_sapscript(
        sapscript_head  = sapscript_head
        sapscript_lines = sapscript_lines
      " set it into the context
      if Not ( formatted_text is initial ).
        wd_context->set_attribute(
        name  = 'FORMATTED1'
        value = formatted_text->m_xml_text ).
      endif.

  • Gateway Service Create with Multiple Line Items

    Hello,
    I observed that you can create an entity in gateway with only a Flat structure, no nested structure or a structure with an internal table is not supported. As i have a requirement of creating a purchase order with multiple items through a create call in gateway service.how do i achieve this.Can any one provide me some direction.
    regards
    Kaushik

    Kaushik,
    In your case Purchase Order header will be an Entity and Purchase Order Line item another entity. You define relationship between them using Associations and Referential Constraints.
    For fetching both at a time, you need to use a '$expand'. For creating both at a time, you use 'Deep Insert'.
    I would suggest you to go through odata.org and search these concepts.
    Also you can read more here.
    Similar Discussion.
    Data model design, Do I need a complex entity?
    About deep Insert
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d92637-3d0d-2f10-ebb2-efc1f40a85e8?QuickLink=index&…
    About $expand
    Basic and Generic Expand - SAP NetWeaver Gateway - SAP Library

  • Multiple Hit Button Without Using The Timeline

    Hello. I'm pretty much a beginner when it comes to flash. So,
    I assume there's been a post about this topic already. But, does
    anyone know how to script a code that lets you hit a button
    multiple times to execute an action without using the time line.
    For example. on
    http://www.group94.com/ website
    under menu / projects they use arrows to move the text on the y
    axis. Every time you click down on the text, it shifts upwards. I
    assume this a multiple hit action since the text shifts to? Can
    anyone help. Thanks.
    George

    Well, every action assigned to a button is executed multiple
    times when the button is hit repeatedly. I assume you mean kind of
    different actions? This could be done with a counter variable and a
    switch statement, like this:
    var count:Number = 0;
    button.onRelease = function(){
    count++;
    switch(count){
    case 1:
    // actions for 1st click
    break;
    case 2:
    break;
    case 5:
    count = 0; // reset counter
    break;
    However, in the website you linked, I suppose they don't do
    it this way, but with a more dynamic approach: Load the data (links
    and linktext) from a xml or text file, then build an array out of
    the contents and display the first entries. When the button is
    clicked, the first entry goes off, the next entry comes in. When
    the end of the array is reached, go back to entry 1 (not sure they
    do that, I didn't try it so far). So you would need a function,
    like displayNext(), that executes on every click and checks for
    itself which is the next entry to display and goes through the
    array this way.
    That's just a guess how they did it, or rather, how I would
    do it. ;)
    hth,
    blemmo

Maybe you are looking for

  • HP P1606dn network printer spools jobs but won't print without a "form feed"

    I recently changed by HP P1606dn printer from a USB connection to my HP desktop running Windows 7 (64bit) to a network connection.  The objective was to allow my Mac (OS 10.6.8) to print to this printers as well via the network.  When I first install

  • ATG 9.4 installation problem with weblogic 10.0.2 MP2

    Hi, I am new in ATG platform and framework. I am trying to install ATG 9.4 on BEA Weblogic 10.0.2 on Windows desktop with the help of Installation guide for ATG. I have completed installation of BEA Weblogic 10.0.2 and then ATG 9.4, giving the correc

  • How can i import dll files in java project in eclipse?

    Hi All, How can i import or link dll files in java project in eclipse?.... dll files contains import com.ms.com.ComLib; import com.ms.com.Variant; import com.ms.com.ComFailException; import com.ms.wfc.data.AdoException; import com.ms.wfc.data.AdoEnum

  • Using AVI files w/final cut

    Tried opening/importing, no luck, only a black screen in the viewer. Strangely, the timeline reflected the length of the clip (12 seconds of AVI video), but fcp was unable to play the video. I ended up having to import the files to a pinnacle system

  • Aperture won't export

    since yesterday i encounter the same problem as some described before. Aperture 'refuses' to export my foto's. It keeps saying 'exporting' in the bottom of the screen and quitting the program is not posibble, the only solution is to perform a forced