How to force the scrollpane not wrap ?

Hi All,
I am creating Editor with JScrollPane.
The JScrollPane contains JTextPane(implements Scrollalbe, etc class) as a Viewport, and this JTextPane is being used rather than JTextArea to have some styles in it (color and fonts..)
My question is...
I am forcing the maximum size of the line by setting the PreferredSize of the JTextPane. However, when it reaches the end of the line, it automatically wraps to the next line. Is there any way to stop to go to next line ? Any ideas ?

Read this sections from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#document]Using Documents. It gives an example of limiting the total number of character to 300. This isn't exactly what you want but it should get you started.
Warning, this task is not as easy as you might think. Also you might want to consider using a JTextArea with a monospaced font. This will make it easier to size the components since it has a constructore that allows you to specify row/columns.

Similar Messages

  • How to Force the Good Plan present in dba_hist_sql_plan for an SQL_ID

    Hi Folks
    Here i have a question on how to fix the query execution plan for which we are facing the problem. The current execution plan of the SQL ID is bad , but the execution plan in dba_hist_sql_plan or v$sql_plan is showing good one's.
    So how to force the plan_hash_value present in dba_hist_sql_plan or v$sql_plan to the current sql. Where in we cannot try using any kind of hints in the SQL so my question here , is there any way to update manually to update the plan_hash_value for the SQL_ID so that it can use the execution plan which we want to force.
    Regards,
    Phani.

    But my question is i have the good plan for the SQL_ID which is now running with the bad plan ( I am able to see the good plan in dba_hist_sql_plan view ) , my challenge here is how to force >the SQL_ID to take good plan PLAN_SQL_HASH_VALUE. Once the query is parsed and in memory I'm not aware of any way of changing the plan :(
    A day later a similar situation came up with one of our clients. I'm still not aware of any way to manually change the execution plan of an already parsed SQL but suspect histograms and/or bind peeking may be a way to explain this phenemenon
    Edited by: riedelme on Jun 18, 2010 6:13 AM

  • How to force the Netscape browser to use Java Plug-in 1.3.0_02?

    For Analyzer 6.2.1, how to force the Netscape browser to use Java Plug-in 1.3.0_02?

    Change the classid in the object tag here is some info.This applies to JRE's 1.3.1 and greater.How do I know what Class ID to use for a specific JRE?CAFEEFAC-0013-0001-0004-ABCDEFFEDCBACAFEEFAC = This tells the browser to force a specific JRE0013-0001-0004 = JRE version number 1.3.1_04 (1.3.1_08 would be 0013-0001-0008)ABCDEFFEDCBA = Just needs to be there.1.3.0_02 = E19F9331-3110-11d4-991C-005004D3B3DB, it seems like they did not implement the standard until v.1.3.1Any good JRE Version = 8AD9C840-044E-11D1-B3E9-00805F499D93, this class id will just look for any good JRE.http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/version.html

  • How to force the "Bluetooth Communicat​ions Port" to be one of COM1 to COM8 ports?

    Dear Lenovo Community, Happy Holidays to you all and wish you a great happy new year. Recently purchased a Bluetooth OBDII device and have difficulty making it to work with its provided software on my T61 (running original XP Home). My short story and question/problem is that I can open "My Bluetooth Places" and pair with the OBDII device as an "OBDII SPP Dev", but my T61 assigns serial port COM19 to it. The OBDII software which came with the device only can let user set to one of the COM1 to COM8 ports and in the properties of Bluetooth pairing, there is no way that I can select which COM port to use. I looked at the Device Manager and I do see these COM port assignments: COM4,5,6,7: Sierra Wireless (the HSDA modem in the laptop which I have never used BTW) COM 9,10,11,12,13,14,15,16,17: Bluetooth Serial Port COM 18, 19: Bluetooth Communications Port and I don't see anything for COM1,2,3, and 8 My question is how to force the computer/OS to assign one of the COM1 to COM8 ports to my device upon pairing? Can I disable the Sierra Wireless model from the COM ports list and hope this will happen? Thanks for your help and inputs beforehand. Regards, AL

    Hi, AL_K
    Have you attempted to change the port number in device manager itself? If you navigate to Device Manager and open the list of Ports, you can right-click on the device you wish to assign a different port number. After right-clicking, click Properties. There should be a tab called Port Settings. In here, you should find a setting to manually assign a port number.
    Good luck, and let me know how it goes,
    Adam
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution!" This will help the rest of the community with similar issues identify the verified solution and benefit from it.

  • How to force the Netscape Browser to open the "Open or Save" dialog box?

    Hi, I tried to force the browser to open the "Open or Save" dailog box for downloading a file.
    response.setContentType(context.getMimeType(file.getName()));
    response.setHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"");
    This works fine with IE for all file types( Even though he prompts twice to Open the file directly). but Netscape opens the file directly in the browser with showing any dialog box for text and html files. Anyone knows how to force the netscape in this case or for any file type? Any help will be appreciated.
    Thanks

    any one has the solution for this issue ? I tried the search and I didnt find any answer.
    when your trying to open a pdf file as attachment is seperate window, it works well in IE but in netscape it opens up in the same browser, it doesnt open a seperate window
    res.setContentType( "application/pdf" );
    res.setHeader("Content-Disposition","attachment; filename=\"" + cofcFileName+"\"");

  • How to prevent the program not to skip the process when exception is genera

    Hi, friends.
    How to prevent the program not to skip the process when exception is generated?
    For example, I am doing a process for 100 records. If the 15th record causes a Java Exception, I want to be able to skip it and continue processing the remaining 85 records.
    How it is possible with Java Exception handling? Any sample code?
    Thanks,
    Jaykishan

    [http://java.sun.com/docs/books/tutorial/essential/exceptions/]
    while (there are more lines) {
      try {
        process the next line
      catch (...) {
        log the error
    }[http://java.sun.com/docs/books/tutorial/essential/exceptions/]
    You'll want to be careful about which exceptions you catch though. For instance, if there's an unchecked exception, like NullPointerException, it's a sign of a bug in your code. Continuing to process as if that bug weren't there is often a worse approach than just failing. In this particular case, however, as long as you log the exception and then followup by fixing the bug that caused it, it may be acceptable to continue trying to process the rest of the file, even if some lines bring out a bug in your code.

  • How to disable the "Reply" not "Reply All" button in Outlook 2010 with GPO

    How to disable the "Reply" not "Reply All" button in Outlook 2010 with GPO
    I need to disable to "Reply" NOT the "Reply All" button/s in Outlook 2010. If possible, then deploy it through GPO also.

    Hi,
    We can disable the "Reply" button by using Control IDs.
    Please first make sure that you have installed the
    Office 2010 Administrative Templates. To disable the "Reply" button, please follow the steps below:
    1. Press Windows key + R to open the Run command, type gpedit.msc and press Enter.
    2. In the Group Policy Object Editor console, expand User Configuration, expand
    Administrative Templates, and then expand Microsoft Outlook 2010.
    3. Expand Disable items in User Interface, click
    Custom, double-click Disable commands, and then click Enabled.
    4. Click Show. In the Show Contents dialog box, enter
    354 (the control ID for “Reply” button) in the Value field, and then click
    OK.
    5. Restart Outlook and you’ll find the “Reply” button is disabled (grayed out).
    For more information, please refer:
    http://technet.microsoft.com/en-us/library/cc179143(v=office.14).aspx
    Regards,
    Steve Fan
    TechNet Community Support

  • How to force JTree to not display  the leaves

    Hi
    Is there anyway to force JTree to not display the "end nodes" so to speak.
    What I want is that if a node is a leaf and is not allowed to have children
    I do not want the JTree to display them.
    I need this to build a component for a custom file system view like Windows Explorer
    which contains a tree with folders on the left and and contents of the currently selected( expanded)
    folder on the right. But Explorer does not display any files in the left pane, only folders.
    So I need to implement the same in my component

    This will give you some things to think aboutimport java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import java.util.*;
    public class Test3 extends JFrame {
      Vector nodes = new Vector();
      DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
      DefaultTreeModel dtm = new DefaultTreeModel(root);
      JTree jt = new JTree(dtm);
      JCheckBox jcb = new JCheckBox("Allow Expansion");
      Random r = new Random();
      int nodeCount=0;
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        addNodes(root,0);
        content.add(jcb, BorderLayout.NORTH);
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.addTreeWillExpandListener(new TreeWillExpandListener() {
          public void treeWillCollapse(TreeExpansionEvent tse) {}
          public void treeWillExpand(TreeExpansionEvent tse) throws ExpandVetoException{
            if (jcb.isSelected()) return;
            TreeNode tn = (TreeNode)tse.getPath().getLastPathComponent();
            Enumeration e = tn.children();
            boolean expand = false;
            while (!expand && e.hasMoreElements()) {
              if (((TreeNode)e.nextElement()).getChildCount()!=0) expand  = true;
            if (!expand) throw new ExpandVetoException(tse);
        setSize(400, 400);
      private void addNodes(DefaultMutableTreeNode parent, int level) {
        int cnt = r.nextInt(3)+3-level;
        for (int i=0; i<cnt; i++) {
          DefaultMutableTreeNode node = new DefaultMutableTreeNode("Node"+nodeCount++);
          parent.add(node);
          nodes.add(node);
          addNodes(node, level+1);
      public static void main(String[] args) { new Test3().setVisible(true); }
    }

  • How to Force the Display to be On? (W520, for Color Calibration Purpose)

    Hi,
    I am trying to get the color calibration to work on Linux on my W520 and the color detector seems to work with dispcalGUI. However, when I close the lid of the laptop, the LCD always turns off. I verified that it is not caused by either acpid or the thinkpad_acpi kernel module by unloading them. I cannot find a BIOS option for this either.
    How can I force the display to stay on when I close the lid?
    Thanks!
    (I am using Gentoo x86_64 with kernel 3.2.12)

    Hi
    Welcome to Lenovo Community
    Have you installed the  PM utilities
    https://wiki.archlinux.org/index.php/Acpid#Tips_and_tricks
    https://wiki.archlinux.org/index.php/Pm-utils
    Hope This Helps
    Cheers!!!

  • How to Force JHS do not generate navigation cases for Groups?

    Hello
    I have already seen "Overwrite faces-config and navigation rules " property for Group in JhsApp deff .But It does not work .How Force JHS do not generate navigation cases for Groups? and another question is that how can I customize navigation case generation in JheadStart?
    Thanks

    Hi,
    You are right: the navigation rules in the main faces-config file are overwritten, even if you uncheck these flags. Here is the solution:
    If you want to preserve some of the navigation rules in the main faces config: alter the velocity template for faces-config. You can only switch off the entire generation of faces-config.xml; not individual parts.
    If you want to add a special navigation rule: add it to the group faces config file.
    If you want to preserve post-generation changes to the group faces config file: uncheck 'generate controller group?' or put it in the templates for that group.
    Note: the flag 'Overwrite Faces-Config beans and Navigation Rules?' has become obsolete, you should only use 'Generate Controller Group?'.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team

  • How to force the user to enter a value in the prompt

    Is there a way to force the user to enter a value in the prompt before they run the report?
    We have a customer specific dashbaord. The user has to enter a customer number in Dashbaord prompt on a first page of the dashboard. We store that value in a presentation variable. That presenatation variable value is being referenced in all the other pages of the dashabord. If the user does not enter a values in the first page and directly navigates to the other pages on the dashbaord, the reports on the other pages start to run for all the customers. Is there a way to force the customer to enter a value in the prompt before running any of the reports on the dashboard?
    Thanks!

    by Answer prompts, do you mean Column prompt?
    I can not use Column prompt in this senario as the user should not have to enter the same customer number over and over again when he navigates from one page to another on the same dashboards. If there is a way to default the column prompts then this would be an acceptable solution.
    I have already defaulted the prompt to a value as suggested in hte blog, but the issues occurs when the user erases the defaulted value. Is there are way to set the default value within the report?
    Can you please explaing mroe about option 3 regarding Java Script. Also please let me know what other options there are so that I can check whether they will fit my needs.
    Thank you very much!

  • Edit_field - is it possible to force text to not wrap?

    Doc excerpts:
    from View attributes LrView text properties:
    width_in_chars : (Read-Only) Calculates the minimum width using this as the number of m characters that should fit. Considered together with width_in_digits. If height_in_lines is set to -1, and width or width_in_digits or width_in_chars is specified, text wraps. (number, default: 15)
    and from View attributes LrView edit view properties
    wraps : (Read-Only)
    True to wrap text. Mac only. (Boolean, default: true)
    (note: read-only means you can't change it after it gets set (not bindable), but plugin does set it's value)
    Question is: is it possible to *not* wrap text in an edit_field, in Windows? (so far all attempts have resulted in wrapped text). I mean, ultimately it would need to not wrap in Mac too, but one step at a time...
    R

    You don't have direct control of the line spacing (leading) for a text field created in Acrobat. You can change the font size, but this often means using a larger size than looks good. You can also simply set the background color of the field to white, which will cover up the lines. This is the approach taken with the following demo: https://workspaces.acrobat.com/?d=AG6oZ3bi3DYHokxDPeWN7A
    When no text is in the field the lines are visible so they can be used if the form is printed and filled by hand.

  • How to implement the security notes in Java System.

    Hi All,
    For the ABAP systems we use RSECNOTE to implement the security notes, but how do we do that in Java systems?
    Any reference or guidance will be of great help.
    Thanks,
    Akash.

    RSECNOTE is for ABAP only, and I dont think there is any equivalent for Java.
    For Java , security note will guide you on how to implement.
    It could be manual changes or via SDM or JSPM.
    Regards,
    Pinkle

  • How to force the unlock screen Keyboard layout as default?

    Hello BB Experts, is there a way to force the unlock screen keyboard layout as the default keyboard layout for everything in my Z30 (except the dial pad). I really love the unlock screen keyboard layout with the top numeric row.  Thanks!

    not that i know of, but it does pop up for password fields

  • How to move the sticky note in adobe touch reader?

    The sticky note in adobe touch reader is automatically places right in the middle of the page. How can i move it ?
    If it helps, im using windows surface rt
    any help would be appreciated... thank you

    When Adobe Reader Touch opens a sticky note, it places the open sticky note right in the middle of the screen like this.
    (Click the image above to enlarge.)
    But it does NOT mean that the sticky note itself has to be placed in the middle of a page.  You can move it to anywhere within a page.
    To move a sticky note, select it with a mouse or your finger and start moving to where you want.  Please note that you cannot move a sticky note outside a page.
    Once you select it, the sticky note icon becomes bigger with the blue border to indicate that it's ready to be moved.
    (Click the image above to enlarge.)

Maybe you are looking for

  • How to put the part of text behind someone a shape or a shape?

    I was thinking about something since I've gotten into magazines recently and the design of them. I was wondering how do they put part of the text behind a person on a magazine cover? Or like have have the text look like it's going around a person(lik

  • Defining NTFS Permissions for High Volume Security

    The default NTFS file permissions for the boot volume in Windows 8.1 appear to give Modify access to "Authenticated Users".   That is really permissive.   I have a lot of folders I do not want anyone not authenticated as Administrator to touch.   Of

  • HT2265 Gen 1 Apple TV.  Can't get photos on my PC to My Photos on Apple TV.  PC and TV appear to be synched.

    Gen1 Apple TV.  Can't get my photos (jpeg) on my PC to My Photos on Apple TV.  PC and Apple TV appear to be synched.  When I go to itunes devices for the TV I have two tabs ( Settings & Photos ).  I've check the box for Share Photos From: and selecte

  • Pre 7 crashes when opening v2 project file

    Hi, I upgraded to v7 from v2 a few months ago.  For the most part things have been going fine, but when I recently tried opening a project file I had worked on in v2 I got the following error: Sorry, a serious error has occurred that requires Adobe P

  • Mouse not working on screen shared Mac

    Screen sharing from Messages works as expected, except the mouse doesn't appear. I see the mouse on my local mouse but when I mouse over to the remove screen/window, the mouse dissapears. The keyboard works– command-tab, for example works on the remo