Interactions between get and JTextPane

I have trouble getting the text in a JTextPane to wrap correctly when they are inside (a-deletion) a get. More specifically, I have:
          JFrame frame = new JFrame();
          JPanel mainPanel = new JPanel();
          mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
          JPanel innerPanel = new JPanel();
          innerPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
                    .createTitledBorder("Border text"), BorderFactory
                    .createEmptyBorder(5, 5, 5, 5)));
          innerPanel.setAlignmentX(JComponent.LEFT_ALIGNMENT);
          innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));
          JTextPane entryPane = new JTextPane();
          entryPane.setAlignmentX(JTextPane.LEFT_ALIGNMENT);
          entryPane.setEditable(false);
          entryPane.setContentType("text/html");
          entryPane
                    .setText("text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text");
          innerPanel.add(entryPane);

          mainPanel.add(innerPanel);

          innerPanel = new JPanel();
          innerPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
                    .createTitledBorder("Border text"), BorderFactory
                    .createEmptyBorder(5, 5, 5, 5)));
          innerPanel.setAlignmentX(JComponent.LEFT_ALIGNMENT);
          innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));
          entryPane = new JTextPane();
          entryPane.setAlignmentX(JTextPane.LEFT_ALIGNMENT);
          entryPane.setEditable(false);
          entryPane.setContentType("text/html");
          entryPane
                    .setText("text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text");
          innerPanel.add(entryPane);

          mainPanel.add(innerPanel);

          // This works
          frame.getContentPane().add(mainPanel);

          // This doesn't
          /*JScrollPane mainScroller = new JScrollPane(mainPanel);
          mainScroller
                    .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
          frame.getContentPane().add(mainScroller);
          */
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          // Display the window.
          frame.pack();
          frame.setVisible(true);
 
With the get out of the game, everything works as I want, but I have many more entries to display and when I activate theJScrollPane, skin stops working. Curiously, if I put the JTextPane directly inside a get, work clothing, but it is not feasible for me, since scrolling must happen at a higher level.

Published by: user10480804 on October 14, 2010 20:16

The suggestion jduprez you should be able to use the [url http://tips4java.wordpress.com/2009/12/20/scrollable-panel/] scroll pane.

Tags: Java

Similar Questions

  • Interactions between Revel and EP 12

    Hello

    I'm a long-time Photoshop Elements user and I recently discovered to Revel.  I use PE on a windows PC and Revel through the web interface and via the iPad app.  I have a question about how they all have the sync/update them.

    I see the changes I make in the ipad app will appear in the web interface when I select 'refresh the albums.  However, apart from sending the album to Revel initially, I don't seem to see updates in ss12.  12 EP is supposed to automatically obtain changes made through the ipad app?

    Go to the other sense (ss12-> Revel), I noted down in the corner of ss12 say sometimes "Updating # Melissa carousel changes", with a number of changes.  No doubt this pushes the changes I did via ss12 to Revel.  (this process seems to take an excessively long time, btw).  I've not been able to find a way to force an update, is it possible?  What drives the PE software to start pushing the changes of Revel, it searches changes from time to time, or it detects changes and then update?

    Also, how Revel dealing with piles of photos in an album ss12?  What happens when I select 'delete album' on the ipad app, this image get deleted from the album in ss12?

    any information would be appreciated!

    Thank you

    mktaj

    The following link explains interation between Revel and ss12. I'm sure this could help you: -.

    https://helpx.Adobe.com/elements-Organizer/using/access-media-using-revel.html

  • NFC Interaction between BB10 and Windows Phone 8

    Hello

    NFC Peer communication Peer is not the case between BB10 and Nokia Lumia 820 (phone 8 window).

    communications made using the Protocol of the SNEP.

    My request in BB10 able to receive Windows Phone data, but the application in windows phone 8 does not receive the data of BB10 when app in BB10 writing data on it.

    WIndows Phone 8 application works very well (to receive and write data) when I hit with BB 7.1 (curved) Mobile, does not work with BB10.

    app in BB10 works well with all mobile BB, the problem only comes with Windows phone 8. But I could not face this kind of problem with BB7.1.

    Problem is that when I type BB10 with Windows phone 8.

    If a question is existed in app BB10, it should not work with mobile BB

    If a question is existed in Windows Phone 8 App, it won't work with BB 7.1 Mobile also.

    I don't come to the solution where the problem is present.

    Please let me know where is the problem?

    Hello

    I got a more or less immediate response from BlackBerry NFC dev team. There are a number of problems known, all rooted in problems with the device of Lumia. I am told that the NFC open P2P connection Bluetooth transfer on the Lumia is inconsistent with the NFC Forum specification. In addition, there are a problem whereby the Lumia P2P server hangs when used with BlackBerry 10. Once again, our engineers are categorically that the problem is with the Lumia. BlackBerry 10 P2P works very well with devices Android and other Nokia devices.

    Concerning

    Martin

  • interactions between widget and widget graphic metric detail application

    I'm trying to configure a dashboard with several interactions.  First of all, I have a health status widget which displays the State of health of the tiers of an application.  When you click a pane it shows the detail of the application of the machines at this level in a retail application widget.  It works very well, I would be able to select a machine in the retail application widget and have settings I choose appear in the metric graph widget.  Now when I created that random metric see room for the machine in the metric graph widget.  I would choose what parameters appear in the metric graph.  Is there anywhere to configure that?

    Yes, set up an interaction of res file to configure the widgets to display always the same attributes. Then, you can apply this file to a Sparkline widget, generic dash or graphic metric.

    Refer to the following instructions: (and make sure that you create the interaction file res under the user "admin" to allow good permanent on the file)

    Set the metric defines for the graphic and metric metric widgets Sparklines

    KB.VMware.com/kb/2011714

  • How do they interact between the stage and the classes?

    Hello

    I asked this question before, and all I got is 'Go back to reading beginner books', so I hope that someone here is willing to actually answer my question rather than brushing because they were unwilling to help...
    And Yes, I have read books on the topic and been through tons of documentation and not found the answer to this. I have 1 ActionScript and JavaScript experience, so this whole thing shouldn't be this hard.

    I am using ActionScript 3 in Flash CS3.

    My problem is the following:

    I need to know how to send commands between the stuff on the stage and stuff which is defined in a class.
    I had this problem for centuries and kept trying to find ways around it since so far I couldn't find help for her.

    For example:
    When you use a document class, how can I get the number of the current frame of the stage?
    Or using a class of documents, how can I access any object (such as a MovieClip with instance name) who has been on the scene with the IDE?

    Currently, to be more precise, I'm doing something really simple:
    Make a button work on my scene, which is not always visible. With AS3, which is not as easy more than before.
    So what I have now, is to create the button in the document class, used addChild and set it to alpha = 0.

    Now, when the stage reached specific images (i.e. those with labels, and I got this part understood), it is supposed to make the button visible. Then I can add stuff and event listeners, and I can understand this part myself.

    I do not know how to access the number of stage of the document class setting, so I put it in a script of frame in frame 1, but now this script cannot access the button that is defined in the document class.

    It makes me bananas...

    Please, here, can someone someone explain to me how can I make this work?

    I've seen many diagrams of the list of display and the object hierarchy, but none of this, explains how to USE effectively all...

    Thank you in advance to anyone who is willing to spend the time to answer!

    Well, first of all, I must say that AS3 is fundamentally designed to be difficult on purpose, this interaction between the objects is intentionally very strict. For this reason, I always use AS2 to all my basic work of Flash. AS3 is just much more involved, much tighter, much less forgiving... it takes a lot of experience with it before it begins to make sense.

    Now, I think I might have a few answers to your questions:
    Any DisplayObject instance (this includes any class of Document, which must extend MovieClip or Sprite instances) you can access the scene using the "stage" property

    However, stadium is probably not exactly what you want, you want the main timeline, which is a child of the stage. To access the main timeline, you can use the 'root' of any DisplayObject property.

    However, unless you have the strict mode off, Flash will let you just say 'root.myMovieClip' because the root property is of type DisplayObject, that is not a dynamic class (which means that you cannot add properties to it) and it has not built in the "myMovieClip" property, so he thinks you did a mistake. You have to "climb" the root as a MovieClip property, which * is * dynamics so it will allow you to try anything on this subject of reference (like AS1/2 does with everything.)

    So what this means is it should work from the inside, document you class:

    .myMovieClip (root as MovieClip)
    or
    MovieClip (root) .myMovieClip

    Either successfully make reference to a MovieClip you set on the main stage in the IDE and named 'myMovieClip '.

    Rather than set the alpha to 0, try the visible parameter to false. I think that this will disable all interactive events, where simply setting alpha to 0 it would still be interactive.

    HTH

  • What is the interaction between appellant VIs and subVIs using VI Server?

    I am student at the CLAD and one of the lines in the document preparation or here is the following:

    What is the interaction between appellant VIs and subVIs using VI Server?

    I know how to use the function "Call for reference" to call a VI, but not necessarily a Subvi. I thought a Subvi is always loaded with the calling VI and has nothing to do with the server of VI. What Miss me?

    Hi Bmihura,

    I think that this article will clear up how the VI Server works with subVIs called statically or dynamically.

    Call a VI by reference

    Best regards

  • I'm having a problem sharing back and forth between xp and vista & get the error that I don't have permission to access files

    original title: sharing of Vista with XP

    I'm having a problem of sharing back and forth between xp and vista.  I've set up the sharing, but I still get the error message that I don't have permission to access files

    Kill / disable the Vista password protection option. If you have installed a separate firewall, configure it.

  • No way to distinguish between failure and normal when to get the document of the UCM?

    Hello

    I use the service GET_FILE below to get the document from the Complutense University of MADRID

    request.putLocal (IdcService.NAME, IdcService.GET_FILE);
    request.putLocal (IdcDocumentAttribute.DOCUMENT_ID, dID);
    request.putLocal (IdcDocumentAttribute.NAME, dDocName);

    and then the output stream:
    ServiceResponse response = client.sendRequest (context, dataBinder);
    InputStream inputStream = response.getResponseStream ();

    they work most of the time very well.
    However, in this case, exception that I can't file, rather than receive exception, I always get a steady stream until I got out of the stream as a string, I realized that this is a format string HDA indicating failure.

    I wonder if there is no way to distinguish between failure and normal exit without open the output string stream?
    Thank you.

    We expect that the user can download the document so successfully in the form of output stream.

    It's probably a bad support, as you have already seen ;-)

    Is the output as string-HDA when the expected of the UCM rather than throwing exception failure?

    It should be pretty easy parse the real answer to retrieve the status code the system riser. You should not need to open the file to find the error.

    Something like

    response.getLocal("StatusCode")
    

    should tell you if the file has been found. A-16 status code means that the file could not be found. In the case of a successful GET_FILE, it does appear that a status code is still present, so test just for the mere presence of a status code should be sufficient.

  • difference between Interactive Reporting (IR) and the reports of Production (PR)

    Could someone tell me the difference between IR and PR Version 9.3.1 or later if its important. My impression is that IR is used for ad hoc reporting, and PR is used for the production of regular reports. I believe you can also create reports that production of IR also, so I don't see where is the difference.

    Thank you
    Tom

    Hi Tom,

    PR or HYPERION SQR PRODUCTION REPORTING focus produces high quality reporting mass. The reports are designed and then demand by admins (or report developers), end users are generally not involved.

    IR or creation of INTERACTIVE REPORTING, HYPERION focuses on ad-hoc data analysis. IR can be put in place to enable end users to modify queries for the purpose of analysis and output then reports or dashboards.

    Here are the 2 cheat sheets:
    http://www.Oracle.com/technology/products/bi/Sqr-production-reporting.html
    http://www.Oracle.com/technology/products/bi/interactive-reporting/index.html

    It could also be useful to check records for yet more information:
    http://download.Oracle.com/docs/CD/E12825_01/NAV/portal_4.htm

    Cheers, Iain

  • Interaction between the two forms

    Hi all

    IAM a beginner to this Summit. I have a problem with the interaction between the forms.

    I have a relationship with the table where I have included for each line like this radio button
    "Select APEX_ITEM. RADIOGROUP (1, r.ID,'7 ') as P10_RG,
    r.ID,
    r.Ref_ID,
    r.Customer_name,
    p.Name as product,
    s.Name as Source,
    c.Name as country,
    of product p, requirements_maintenance r, source, country c

    so if I have a radio button on a particular line and you click a tab in the header, go to another form where I should be able to get details of the line I selected in the previous form.

    I tried several ways to get the values using javascript, but it grabbed nulls as
    $x('P10_RG_0').value but I do not get it.
    Please can someone me wat is the solution for this?

    Hello

    If your next page (ie the redirected page) is page no. 10

    "Select APEX_ITEM. RADIOGROUP (1, r.ID, 'null', null,'onclick = "document.location.href =" f? p = & APP_ID.: * 10 *: & SESSION.: REGION3: & DEBUG.:RP:P10_R_ID:' | r.ID |'") » ''") "

    and on page no. 10 have an element named P10_R_ID as a hidden item.

    Good bye
    Sonny_starck

  • Localhost UDP connection between FCR and Matlab

    Hi all

    I have a question about the connection between Matlab and FCR UDP. My idea is to Exchange data between Matlab and Labview on the same computer.

    So I found the 'UDP Simple' of the FCR 2.0 sample project where periodically a datasample is generated randomly and sent to the remoteport 61557 local host. In the project a 'fractional number of string for transmission' is used for the transmission of data. The receiver of the sample project reads from the same port to receive the datasample.

    Now, I'm interested to read this simple stream from Matlab (just at first), however, it does not work and I'm not sure why. What I do in Matlab is the following (code Matlab)

    delete variables;
    u = udp ('127.0.0.1', 61557); % Of installation UDP Object
    fopen (u); open reading port %
    A = fread (u, 1);  % read an element
    fclose (u);

    With this code, however, I get a timeout by saying: "' WARNING: unsuccessful reading: the amount of data specified has not been returned within the time limit." "

    I'm not sure why this happens, maybe you could help me out here? I guess that the formet serving to VCF is not the same as in Matlab? Maybe the Terminators are not the same?

    See you soon,.

    Steve0

    Hey

    So, regarding the problem actually, I found the solution today. It was not the firewall, but a simple configuration in Matlab seting the UDP port. So the side of Matlab, to change the definition of udp object according to

    u = udp ('127.0.0.1', 'Thelocalport', 61557);

    If you have

    u = udp ('127.0.0.1', 'Thelocalport', 61557);
    fopen (u);

    A = fread (u)

    fclose (u);
    Delete (u);

    Who does the trick and you can read from the port. Then of course you say Matlab that you read from the "LocalPort" x, which I wasn't aware of.

    On the transmitter side, you simply:

    u = udp ('127.0.0.1', 61557);

    fopen (u);

    fwrite (u, '1');

    fclose (u);
    Delete (u);

    Here, you set just the port of transmiting.

    About the format of the data: I used the simple UDP protocol streaming Comms project where a random number is generated as a double, transformed into a string (ASCII values) and transmitted. At the level of the receiver, you get as much the UDP packet with the ASCII values that you must turn if you want to find the number.

    I hope this helps anyone having the same problem.

    See you soon

  • Passing variables between LabVIEW and TestStand

    Hello

    I'm just learning how to use TestStand and although there are a multitude of resources available, I always find me at a loss on how to pass variables between TS and LV, leaving me to think that there is one fundamental thing that I'm missing which is likely, given that I have a weeks experience with LabVIEW and a days of experience with TestStand.

    I took a glance to the example of 'Clusters' to the Code Modules in TestStand examples (I use TS 2016 if it matters) because I thought it would be quite ideal for what I hope. In this case, I hope to be able to pass a string (a file path) to LabVIEW and VI power take this string and use it as part of an order for the Exec.VI system.  Then, I would be able to pass strings back to TestStand to show the user if an error occurred, but I thought I should get the first part of work.

    I guess my question is what do I have to wait to see in clusters to the example of the Modules of Code? The Watch window displays all defined variables premise on which has the ContainerOut in the Variables pane, but I don't see any kind of update on facades (VI1.vi and VI2.vi) LabVIEW code. Should I be?

    I looked at a few other discussions of the forum here and here, as well as the document of the basis of knowledge here, but could not recreate their solutions. It seems that the connector pane would be a viable way to go, but I'm not sure on how we create and use effectively. According to this document , it makes it seem like it should be simple enough to makes these terminals, but I am still missing a key step. I was able to follow all the steps on the knowledge base document and run the sequence, but then had no idea if it worked or not; I have the report show me the values of the variables I put, but I have no idea whether or not he actually did anything with the LabVIEW VI, or how I could see that.

    Please let me know if you need further information or clarifaction everything I ask.

    Thank you for your time,
    JColvin

    Digilent, a company of National Instruments

    If you want to enter values, you must create a vi for instance dialog box

    The OK button will allow new values to pass to the output terminals.

    A Cancel button will pass just the original through the output values without alteration. The VI will close when either the OK button or cancel were pressed.

    Concerning

    Ray

  • Ideas on how to create a sine wave between 0 and 10 V with NI 5412?

    Hello

    I tried to create a sine wave from 0 to 10 volts on a 5412 OR. I have 2 problems and I have a question:

    (1) I can't generate a waveform with lag, even when using the examples of NEITHER.

    (2) the value of the offset, that I can set the camera is of +/-25% range of amplitudes. Do I have to create an arbitrary waveform myself?

    (3) in the brochure it says I can get 12 v peak-to-peak. Does this mean that it is between-6 and 6, or it is between 0 and 12?

    I would appreciate it if I could see an example.

    Thank you very much.

    Hi, several notes:

    (1) the peak to peak voltage is 12V. For example, it can operate between 0 - 12V.

    (2) the shift of 25% limit is for a given wave. That means assuming that it will create a wave, it cannot compensate for 25% of the beach. The solution is to create an arbitrary wave (e.g. a sine between 0 and 10 V) and the function generator to create rather than attempt to compensate for a sine wave.

    Thanks for the help though.

  • Connect the large number of parameters and variables between Verstand and model of Labview

    We have an installer of dyno with a chassis PXI-E running Veristand 2014 and 2014, inertia. In order to strengthen the capabilities and timing of the Veristand, I would use models of Labview to perform tasks is not possible by Veristand and inertia. An example of this is to determine the maximum amount of a large number of thermocouples. VeriStand has a comparison function, but it compares two values at once. This makes long and rigid emissions. LabVIEW, on the other hand, has a function which words one to get the maximum items in a table in one step. I need to use Labview to 'send' the thermocouples of 50 or more to the Labview model. In addition to the variables that must be communicated between Veristand and Labview, I also need to present Labview with the threshold and setting parameters. Forums and user manuaIs understand that you must use the connector pane in Labview Veristand System Explorer mapping to expose the inports and isolated villages. The problem is that the part of Labview connector is limited to 27 I/O. How to overcome this limitation?

    BTW. I'm relatively new to Labview and Versitand.

    Thank you.

    Richard

    You can work around this limitation by putting your orders and clusters indicators. Then set the cluster to be required or recommended to indicate whether contained controls are entered or parameters, just normal.

  • Series communication between computer and cRIO

    Hello

    I am not new to Labview or cRIO programming, however, venture in for my first try at the serial communication.  I have a controller (not original NOR) that sends data over a serial RS232 network I want to open a parallel session to the data that I collect with a cRIO.  Before we get to integrate, I try to test with a series, my computer cable and hyperterminal communications and the serial port cRIO.  I followed and validated exploitation and drivers with the following text:

    How to do a loopback Test series
    http://www.NI.com/white-paper/3450/en

    However, when I try to use the following example, I get nothing:

    Transfer data between cRIO and host series
    https://decibel.NI.com/content/docs/doc-3816

    Any ideas on where to start?  I appreciate very much all the advice.

    Thank you.

    I have confirmed that it is a right.  I'll try a null-modem cable.

    Thank you!

Maybe you are looking for

  • Sometimes the LCD goes white on Satellite M70

    Hello I have a problem sometimes my lcd screen goes black but the sound and the couture of other orders to work. But today, I was a movie, and all of a sudden my screen has turned the whites of watchig. The sound and the other controls set to work. I

  • HP Deskjet 2520: HP Deskjet 2520 problem

    I have a printer of HP Deskjet 2520wireless for awhile.  All of a sudden, I had a problem printing.  He repeated that it was out of line or that there are documents in the print queue.  I don't have the installation disk and I uninstalled the printer

  • The change of motherboard Pavillion DV9500 - compatibility

    Hello I have a computer portable pavilion DV9500 (code dv9541ev), and as usual for these series, the NVIDIA GPU failed. I got scratches on the screed and the resolution is 640 x 480.  I tried reformatting the chip bad using a heatgun, but I made it w

  • Is the Radeon HD 6450 A 24/96 or 24/192

    I reformatted my Lenovo Q 180, and it is to show the supported audio 24/96 bit sound on HDMI. I think if I remember correctly, I saw HDMI support for audio 24/192. But I don't recall. Support 24/192? And if it supports 24/192 bit sound how to set up

  • HP deskjet 2545: Re: How do I fix my printer HP 2545 wifi password

    before I used hp envy x 360 link for my printer hp deskjet 2545 have no password, but after I created the priner to my lappy after fomating, automatic password printer set up without my own password. who can spolve my problem please answer passes my