Now possible to scroll line-wrapped output in window of ModalDialog?

Hello,
At some point the plugin I am working on must display a window with extracted values (varPathName), in this case the full-path-names to image files.
Depending on the users selection there are many or only a few full-path-names in the output.
The output is one line that wraps within the given width of the window and should remain so.
No problem for adjusting the height of the window by calculating the value for the variable 'outputlines'.
But sometimes there might be more output than available space inside the window (full height on the screen). Therefore I would like to have a scroll-bar on the right side of the window.
How can this be achieved given the code below. Is it possible to create a scroll-bar after all?
local f = LrView.osFactory()
     local c = f:row{
          bind_to_object = props,
               f:column {
                    f:edit_field {
                         value = varPathName,
                         width_in_chars = 80,
                         height_in_lines = outputlines
     dialogValue = LrDialogs.presentModalDialog({
          title = "extracted Paths and File Names" ,
          contents = c,
Feedback is much appreciated.
(reference: http://forums.adobe.com/message/3190135#3190135)
Message was edited by: snahphoto

Thanks Rob,
so the output gets saved to a file in the system-temp folder and then opened in an editor.
Like this:
communicatorFile = LrFileUtils.chooseUniqueFileName(LrFileUtils.chooseUniqueFileName( LrPathUtils.child(LrPathUtils.getStandardFilePath("temp"), "FilesPathsList_string.txt")))
local createFile = assert(io.open(communicatorFile,"w+"))
     createFile:write(varPathName)
     createFile:close()
fileToOpen = string.format("%q", communicatorFile)
LrShell.openFilesInApp( { fileToOpen }, "notepad.exe")

Similar Messages

  • Are there any apps that make it now possible to scroll with Mountain Lion ?

    I just gave up on a project that required me to be able to scroll through a Senate bill. I'll probably go back, but it just shouldn't be so difficult, so painful. and I'm not talking about the bill's language. No, it's just Apple's decision to do away with the USEABLE search arrows that existed before Mountain Lion, and, yes, I know that you can use the little up and down triangles--sometimes--for this purpose.  I have written to Apple about this on more than one occasion, but I never felt that this would do any good. Anyway, I came here to see if anyone knows of an app that has been developed to overcome this strange, almost malicious, behavior of Apple's. Are there any apps I can use on my iMac for scrolling? If not why not? I know I have a lot of company in my disgust with Apple's behavior, so I have to there is some prohibitively difficult problem that makes such a fix impossible. Is that the reason why no one has come to the rescue of Apple's suffering customers?

    For very long documents in PDF or on a web page, I just lean on the space bar for big jumps (Shift-spacebar goes up), or on the down arrow keys for short scrolling. If I'm on my laptop, the trackpad provides both large jumps and fine control. If I'm on my desktop, I love my scroll wheel mouse.
    In apps like Word, you can't scroll with the spacebar because you need it to type spaces, so I just use the Page Up/Page Down keys. On short Mac keyboards you press Fn+Up Arrow or Fn+Down Arrow to page up/down.
    There are so many more and better ways to scroll now compared to the 1980s when the only way was to click-click-click over and over again on stupid scroll arrows. If it stopped scrolling it meant you had to re-aim the mouse because the mouse slipped a little and the arrow is no longer hitting the arrow. If you wanted to scroll up, you had to move the mouse quite a ways because the arrows were on opposite ends of the bar. Scroll arrows were the worst and least efficient way to scroll and I don't miss them at all.
    I'm glad we have so many superior alternatives now where, unlike scroll arrows, you don't even have to look at the screen to scroll quickly and accurately. Today, the only good use for a scroll bar is to tell you how far you are through the document.

  • HTML lines wrap around in the HTML report output

    I seem to have a problem with lines wrapping around in HTML format. If the report is ran using the report builder the output will fit in every line without wrapping the information.
    While if I run the same report -- to present the info using a browser -- using JSP in HTML format, the same lines will wrap around the info in two lines.
    Here is how I send this document to the server :
    pwrmpos_n: report=pwrmpos.rep destype=cache desformat=html server=rep60_wforms2 %*
    Any help will be appreciated

    Hello Hernando,
    I am a little confused, the command that you describe is only for paper layout...
    Anyway, let's try to help you:
    - on your paper layout you specified a width for each column (when you resize it in the Paper Design window). When you run the paper layout with HTML (ot HTMLCSS) as format the width is present in the <TD> tag.
    - for the JSP, by default the HTML does not contains any size for the table and cell so the browser size the table to fit in the screen.
    If you do not want any wrapping in the JSP just modify the HTML tags to specify a width, or wrap for the TD tag.
    Regards
    Tugdual

  • Line wrapping and scrolling in JPanel

    Hello,
    I've got an empty JPanel to which I want to add an (unknown) number of JLabels. Each JLabel has a text which is just one word. When my program is adding JLabels to the JPanel, I want it to have the same behaviour as a normal text editor: when a line is full, the next line gets filled (line wrapping).
    If I just keep adding JLabels to a JPanel of a fixed size with .add(), there's no line wrapping. I tried it by giving the JPanel a fixed size, flowLayout and nesting it within a JScrollPane, but it keeps filling one long line, instead of jumping to the next one.
    Any obvious solutions??
    Thanks
    Mark

    well this depends on how your layout is build, you should post some code so we can see what your trying to do.
    For example if your JPanel is the Frame's main panel, fixing a MaximumSize or PreferredSize wont have any effect, it will grow as big as you defined the JFrame size.
    If you have only a JPanel with a max size of 200,300 in a JFrame with a size of 800,600, it will grow to 800,600.
    You could create a BoxLayout with X axis, then insert an HorizontalStruts, insert your JPanel and another Horizontal Struts(Box.createHorizontalStrut(int width) ) to force the JPanel to be smaller than the JFrame.
    I did not test this a lot, but it seams to work
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Test {
      public static MyFrame frame ;
      public static void main(String[] args) {
        frame = new MyFrame();
        frame.show(true);
        frame.pack();
      public static class MyFrame extends JFrame {
        JLabel a, b, c, d, e, f, g, h, i, j, k ;
        public MyFrame(){
          super();
          JPanel sizeLimiter = (JPanel)this.getContentPane();
          sizeLimiter.setLayout(new BoxLayout(sizeLimiter, BoxLayout.X_AXIS));
         // sizeLimiter.setPreferredSize(new Dimension(800,600));
          JPanel mainPanel = new JPanel();
          mainPanel.setLayout(new FlowLayout());
          mainPanel.setPreferredSize(new Dimension(400,300));
          mainPanel.setMinimumSize(new Dimension(400,300));
          a = new JLabel("this is sample test ");
          b = new JLabel("to demonstrate an example ");
          c = new JLabel("of simple a flow layout ");
          d = new JLabel("which is wrapping ");
          e = new JLabel("when it reaches the end ");
          f = new JLabel("of a line. ");
          g = new JLabel("Set the maximum size of the panel ");
          h = new JLabel("And it should work ");
          i = new JLabel("If it doesnt post your code so we can");
          j = new JLabel("check it out to see whats wrong ");
          k = new JLabel("sincerly yours, Jf Beaulac ");
          mainPanel.add(a);
          mainPanel.add(b);
          mainPanel.add(c);
          mainPanel.add(d);
          mainPanel.add(e);
          mainPanel.add(f);
          mainPanel.add(g);
          mainPanel.add(h);
          mainPanel.add(i);
          mainPanel.add(j);
          mainPanel.add(k);
          // Fix some "margins"
          sizeLimiter.add(Box.createHorizontalStrut(200));
          // Squeeze the panel
          sizeLimiter.add(mainPanel);
          sizeLimiter.add(Box.createHorizontalStrut(200));
        protected void processWindowEvent(WindowEvent e) {
          super.processWindowEvent(e);
          if (e.getID() == WindowEvent.WINDOW_CLOSING) {
            this.dispose();
    }Regards,
    Jf Beaulac

  • Creating Packages from BLOB field contents, line wrap problems

    Good afternoon,
    we use an in-house developed database-driven update system to update both our databases and filesystems, the system itself performs really well but there is still one problem I can't fix without some expert help:
    the code of to-be-updated Oracle packages is stored inside of a BLOB field, the BLOB field will contain both the package specification and package body and needs to be split into two parts to first execute the spec and then to execute the package body (I tried to execute both in a single step but this didn't work). This works for packages with less than 32767 characters and also works in some other cases but I found one case where the executed code contains an extra line wrap right in the middle of a word.
    To make it more clear (I hope it's comprehensible), imagine the following database content:
    CREATE OR REPLACE Package
    MyPack
    AS
    [... a lot procedure headers ...]
    END MyPack;
    CREATE OR REPLACE
    Package Body MyPack AS
    [... a lot more procedures ...]
    PROCEDURE myTest (intID OUT integer)
    AS
    BEGIN
      SELECT count (*) into intID FROM MyTa[--this is where the dbms_lob.substr() ends --]ble;
    END;
    END MyPack;My code searches for the second occurrence of the "Create or replace package", splits the code into spec and body, executes the specification and keeps on adding the rest of the code to a VARCHAR2A variable called "storedCode" from the BLOB. Now in the above example, after the specification has been removed from the string, the remaining characters (ending with the "MyTa" string) are added to the varchar2a variable, the next line is fetched from the BLOB via "dbms_lob.substr()" and added as long as dbms_lob.substr() does not return a NULL value (end of BLOB). When the code is executed after all has been fetched, the generated Package Body will contain an extra line wrap right in the middle of the "MyTable" word compiling the package invalid.
    This is the procedure code I use (definitely improvable, I'm better in MSSQL and MySQL dialects ...) to load, parse and execute the BLOB content:
       -- to run package code
      procedure runPackageCode (stepRef integer)
      AS
        numLines integer default 1;
        pos     integer default 1;
        storedCode    LOG_CHANGEDOBJECT.STOREDOBJECT%type;
        objectCursor  integer;
        lSqlOut     integer;
        sqlCommand  dbms_sql.varchar2a;
        emptyCommand dbms_sql.varchar2a;
        pIsError integer := 0;
        pErrorMsg varchar2(200) := '';
        updateRef integer := 0;
        currentUpdate integer := 0;
        schemaReference varchar2(20);
        -- required to do string cutting
        strLine varchar2(32767);
        strLeftFromSlash varchar2(32767);
        strRemaining varchar2(32767);
        intDelimiterPos integer := 0;
      begin
        -- retrieve update ID
        SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;
         begin
            select storedobject, change_area
            into storedCode, schemaReference
            from vw_storedobjects
            where step_id = stepRef;
         exception
          when no_data_found then
            pIsError := 1;
            pErrorMsg := 'Invalid SQL ID ' || stepRef;
            pkg_generic.LogError(updateRef, 'LocalUpdater', stepRef, 'Run package code failed: ' || pErrorMsg);
         end;
          if pIsError = 0 then     
            begin
              -- change schema
              execute immediate 'alter session set current_schema = ' || schemaReference;         
              objectCursor := dbms_sql.open_cursor;   
              loop
                strLine := UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(storedCode, 32767, pos));
                intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                while intDelimiterPos > 0
                loop
                  -- '/' found, execute currently stored statement
                  strLeftFromSlash := substr(strLine, 1, intDelimiterPos-1);
                  strLine := substr(strLine, intDelimiterPos);
                  -- execute the extracted part without any '/' in it
                  sqlCommand(numLines) := regexp_replace(strLeftFromSlash, '(^|\s+)/(\s+|$)', '', 1, 0, 'm');
                  if (sqlCommand(numLines) is not null) then
                    objectCursor := dbms_sql.open_cursor;   
                    dbms_sql.parse(objectCursor, sqlCommand, 1, numLines, true, dbms_sql.native);
                    lSqlOut := dbms_sql.execute(objectCursor);
                    dbms_sql.close_cursor(objectCursor);
                  end if;
                  -- reset sqlCommand
                  sqlCommand := emptyCommand;
                  -- reset line counter and store remaining string
                  numLines := 1;
                  -- check for further '/'s           
                  intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                end loop;
                -- add the remaining strLine to the sqlCommand
                strLine := regexp_replace(strLine, '(^|\s+)/(\s+|$)', '', 1, 0, 'm');
       --> I assume this line breaks the code, lpad()'ing the content to move it to the end of a varchar2a line didn't help
                sqlCommand(numLines) := strLine;
                exit when sqlCommand(numLines) is null;
                pos := pos+32767;
                numLines := numLines+1;
              end loop;
              objectCursor := dbms_sql.open_cursor;   
              dbms_sql.parse(objectCursor, sqlCommand, 1, numLines, true, dbms_sql.native);   
              lSqlOut := dbms_sql.execute(objectCursor);
              dbms_sql.close_cursor(objectCursor);
              commit;
              -- reset schema
              execute immediate 'alter session set current_schema = UPDATE_DB';
              -- set state to installed
              pkg_update.setstepstate(stepRef, 'Installed');
        exception
        when others then
              -- reset schema
              execute immediate 'alter session set current_schema = UPDATE_DB';
              -- set state to installFailed
              pkg_update.setstepstate(stepRef, 'InstallFailed');
              pkg_generic.LogError(updateRef, 'Database', stepRef, 'Run package code failed: ' || sqlerrm);
        end;
        end if;
      END;    Thanks if you kept on reading so far, I would really appreciate any feedback!
    Regards, Sascha

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    Thanks for providing an easy-to-understand problem statement and for using code tags.
    >
    the code of to-be-updated Oracle packages is stored inside of a BLOB field
    >
    This should be stored in a CLOB since it is character data. Why are you using BLOB?
    >
    the BLOB field will contain both the package specification and package body and needs to be split into two parts to first execute the spec and then to execute the package body
    >
    Good, clear problem statement. So why doesn't your code do just what you said it should do: 1) split the code into two parts, 2) execute the spec and 3) execute the body.
    Instead of writing code that does these three relatively simple steps your code tries to combine splitting and executing and mushes/mashes it all together. The result, as you found, is code that is hard to understand, hard to debug, doesn't work and doesn't report on what it is doing.
    Code like this doesn't have a performance issue so the code should implement the simple step-by-step process that you so elegantly stated in your problem description:
    1. split the code into two parts
    2. execute the spec
    3. execute the body
    My advice is to refactor your code to perform the above steps in the proper order and to add proper exception handling and reporting for each step. Then when a step isn't working you will know exactly where and what the problem is.
    Here are my recommendations.
    1. Add two CLOB variables - one will hold the spec, the second will hold the body
    2. Add a comment (you have some good ones in the code now) for every step no matter how trivial it may be
    3. Add exception/error handling to EVERY STEP
    Your code for the first step has a comment but no exception handling. What should happen if you don't get any data? Why aren't you validating the data you get? Dynamic SQL using table-driven data is great, I love it, but you MUST validate that the data you get is what you expect to get.
        -- retrieve update ID
        SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;Recommended
        -- step 1 - retrieve update ID - This is the id that determines BLAH, BLAH, BLAH - add appropriate to tell a new developer what this ID is and what it means.
        BEGIN
            SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;
        EXCEPTION
            WHEN ??? THEN -- what should happen if step 1 fails? Do it here - don't default to an exception handler that is several pages away.
        END;Your code
         begin
            select storedobject, change_area
            into storedCode, schemaReference
            from vw_storedobjects
            where step_id = stepRef;
         exception
          when no_data_found then
            pIsError := 1;
            pErrorMsg := 'Invalid SQL ID ' || stepRef;
            pkg_generic.LogError(updateRef, 'LocalUpdater', stepRef, 'Run package code failed: ' || pErrorMsg);
         end;
    Good - except there is no comment that says what this does - I assume that the query above and this block are the 'retrieve update ID ' step?
    You log an error message and set the error flag to '1'. But since you don't want to continue why aren't you exiting the procedure and returning right here?
          if pIsError = 0 then     
            beginSo now you check the error flag and do several pages of code if there were no errors.
    I don't like that 'inverted' logic.
    If you don't want to continue then STOP right now! Don't make a developer scan through pages and pages of code to find out you really aren't doing anything else if there was an error.
    Either put a RETURN statement in the exception handler above or change your code to
          if pIsError = 1 then     
            RETURN;
          end if;Now the rest of the code doesn' t have to be indented; you will never get there if there is an error. Check for errors after every step and exit right then as appropriate.
              -- change schema
              execute immediate 'alter session set current_schema = ' || schemaReference;         
              objectCursor := dbms_sql.open_cursor;   
              loop
                strLine := UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(storedCode, 32767, pos));
                intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                while intDelimiterPos > 0
                loopThis code mixes all of the steps together into one giant mess. You open a cursor, try to split the BLOB into spec and body and try to parse and execute both all within a double nested loop.
    Even if that works correctly another developer will have a hard time understanding what the code is doing and fixing it if it goes wrong. And it will go wrong if you let me test if for you because I will put garbage into the BLOB for the spec, body or both to make sure it breaks and to see how your code handles it.
    I suggest you rewrite this double nested loop to perform the three steps separately.
    1. split the code into two parts
    a. put the spec into one new CLOB variable and the body into the other.
    b. use DBMS_OUTPUT (or a work table) to output the spec and body so you can see what the code is and make sure the 'split' process worked properly. You probably created that BLOB by manually concatenating the SPEC and BODY to begin with so now create a SPLIT process to split them again and give them back to you. This is such a fundamental component that I suggest creating a new SPLIT_MY_BLOB procedure. This procedure would take a BLOB and return two CLOBS as OUT parameters: one CLOB is the spec and one is the body. Then you can reuse this 'split' procedure in other code or more complex versions of code. Modular programming is the key.
    2. execute the spec - Now have a step that executes the spec and does something appropriate if the step succeeds or if it fails. I mean, do you really want to do execute the body if the spec execution fails? What do you want to do? Should you delete the body and spec? If you don't you might wind up with an INVALID body based on old code and an INVALID spec based on the new code you were trying to use. How will anyone, including you, know that the spec and body in the ALL_SOURCE view is really two different versions of things?
    This suggests that for your use case you may want to consider DROPPING the entire package, spec and body, before trying to recreate them both. At least if the package is totally missing anyone will know that the entire thing needs to be put back. Ahhhh - but to do that you need to know the package name so you can drop it. Than may require adding another step to get the package name from your data-driven table and adding a DROP PACKAGE step.
    3. execute the body - This step executes the body. Hmmmm - we have two nearly identical steps. So why don't you create a new function/procedure that takes a CLOB as input, uses dynamic sql to execute it and returns a result code. That would be useful. Then you could execute ANY sql stored in a CLOB and have a generic function that you can use for other things.
    Right now you are using the VARCHAR2 table version of DBMS_SQL.PARSE but you would change this to use the CLOB version.
    The end result of this refactoring is a main function/procedure that acts as the CONTROL - it decides what to do and what data (BLOB) to do it with. But it doesn't actually do ANY of the work. It just controls what is done.
    And you have a couple of generic, reuseable functions that actually do the work. One knows how to split a CLOB into spec and body. The other knows how to use dynamic SQL to execute a CLOB.
    Now you have a modular architecture that is easy to understand, easy to code and easy to test.

  • Disable Line wrap in Terminal

    How do you disable line wrap in bash? As in
    $ls -la
    or
    mysql> select * from db;
    displaying exceedingly lengthy data. Or perhaps readline options to disable wrapping?
    May be just a horizontal scroll bar in Terminal?

    Thanks for responding. I believe that setting is for input not output. Plus it is on. I think terminal needs a horizontal scrool bar.
    $ bind -v
    set bind-tty-special-chars on
    set blink-matching-paren on
    set byte-oriented off
    set completion-ignore-case off
    set convert-meta off
    set disable-completion off
    set enable-keypad off
    set expand-tilde off
    set history-preserve-point off
    set horizontal-scroll-mode on
    set input-meta on
    set mark-directories on
    set mark-modified-lines off
    set mark-symlinked-directories off
    set match-hidden-files on
    set meta-flag on
    set output-meta on
    set page-completions on
    set prefer-visible-bell on
    set print-completions-horizontally off
    set show-all-if-ambiguous off
    set show-all-if-unmodified off
    set visible-stats off
    set bell-style audible
    set comment-begin #
    set completion-query-items 100
    set editing-mode emacs
    set keymap emacs

  • [X300] Mouse Wheel Scroll Lines Setting does not stick

    I often use an external mouse (no additional driver needed). After every reboot, the setting "Mouse Wheel Scroll Lines" in Control-Panel -> Mouse -> Wheel is reset to 1 (I am using Vista). This is really annoying because it slows down scrolling extremely.
    Does anyone have the same problem?
    I think its caused somehow by the ALPS touchpad driver (The X300 has a really bad one, the Synaptics pads built in previous Thinkpads were WAY BETTER).

    wfaz wrote:
    VPN User ...
    Have you made any progress?  I am having no luck getting the X300 touchpad to scroll with MANY applications: Photoshop, Illustrator, Access to mention some.  I use Windows XP - another user has complained that with Vista he does not getting scrolling to work with iTunes, Live Search.  Plus, wheel events are not handled by the Remote Desktop, so anytime you are tunneling, you don't get touchpad scrolling.  I have been expecting a new UltraNav driver for months - but nothing yet.  I think I have tried every combination of touchpad and trackpoint settings possible, but maybe you know something I don't.
    WFaz
    I am sorry but the problem you describe is a completely different one. Personally, I don' t care for these few applications, especially iTunes and further rubbish. Fact is, the quality Ultranav2 Driver is much much worse compared to the Ultranav1 which uses a Synaptic touchpad. Responsiveness, accuracy, supported applications, bugs are much worse with the Ultranav2 used in X300.
    AFAIK adding applications to support the touchpad needs just adding them to some list in registry or what. But as I said, I never cared for that. The problem that the driver resets mouse settings when using it, I find much more disturbing.

  • How can I set line wrap on a JButton??

    Hi...
    I am working on an application that required to have a long label on a button and I was wondering if anyone know how to set line wrap on a JButton. Any suggestion will be greatly appreciate.

    If it is not inconvenient for you to use mouse events instead of action events this procedure may be adequate.
    Invoke "createImage" on the JButton to obtain an "Image" object then use "getGraphics" on the image object to get "Graphics" object. Next call "getFontMetrics" on the "Graphics" object to obtain "FontMetrics". Now you can get the size of a String drawn from the "drawString" method of the "Graphics" object. This can be obtained in an int returned from "getHeight" method in "FontMetrics".
    You can obtain the center of the "Image" by using "getSize" method from JButton and dividing it by 2.
    You can get the width of characters by using "FontMetrics" "charsWidth" method. Now you can use the int returned from charsWidth and getHeight to align text in the JButton "Image" by using the "Dimension"
    object returned by the "getSize" method. Now invoke
    the "drawString" method for as many lines of text as you would like to display. After finished drawing strings you
    construct an ImageIcon with its one parameter being the "Image" object you have created and drawn on.
    Now you invoke the "setIcon" method of JButton to insert the ImageIcon as the image displayed on the JButton.
    At this point you have a JButton with all the text you want displayed on it, but with no event handling. So
    you are going to add a MouseListener to the JButton.
    In the MouseListener override the "mouseClicked" method
    inside the method obtain the MouseEvent's location through "getX" and "getY". Next invoke the JButton's
    "getLocation" method to obtain a "Point" object. Now invoke the "Point" objects "getX" and "getY" methods to return the int locations of the origin of the JButton.
    Now invoke the "getSize" method of the JButton to get
    a "Dimension" object containing the size of the JButton.
    Now you can use boolean operations to determine if the
    x, y coordinate that was obtained by the MouseEvent falls within the boundries of the JButton component.
    Something like this:
    public void mouseClicked(MouseEvent mouseEvent) {
    Point point=jbutton.getLocation();
    Dimension dimension=jbutton.getSize();
    int pX=point.getX();
    int pY=point.getY();
    int dW=dimension.width;
    int dH=dimension.height;
    int mX=mouseEvent.getX();
    int mY=mouseEvent.getY();
    if(mX>pX & mX<(pX+dW)) {
    if(mY>pY & mY<(pY+dH)) {
    //This means that the point does indeed fall within
    //the boundries of the JButton, so place the code
    //that would normally appear in actionPerformed
    //within this code block
    Good Luck.

  • Line wrapping and font styles?

    Hi,
    If I have a piece of text which I would like to see line wrapped, and font styled, how should I do that?
    javax.swing.JTextArea has the capabilities to set line wrapping to on.
    javax.swing.JTextPane has the capabilities to set font styles like bold, italic and so on.
    But what if you have a piece of text you don't know the (possible) length of (so you would like to have line wrapping), AND to which you want to apply font styles to. JTextArea and JTextPane are siblings, not ancestors. So I can't use it. I have looked in the code to see if I could use pieces of code in my own program. But not luck.
    Do you have a suggestion for me?
    TIA,
    Abel

    camickr wrote:
    JTextPane wraps by default. I'm not sure what your problem is.I did not know that JTextPane did wrap. And I could not find it in the documentation.
    But thanks for the information!

  • Overide Line wrapping in JTextComponent

    Howdy !
    Anybody knows how can I achieve my own custom line wrap code for a JTextComponent/JTextPane. I see that these components use the white space as the bench mark to wrap a line. Now if I find and Replace a white space with say &n b s p; , how would I have the document of the JTextComponent identify it as the line break character. Parlay ! if I dont make any sense.
    Thanks Galore
    Dan

    Can BreakIterator be associated with a JTextPane for this. Somebody Please ?

  • Sound - Change input line to output line

    Hi to everyone I just have a question.
    It is possible to change the input line to output to have an stereo output?
    I use pulseaudio. My sound works great. Even when I connect earphones, the audio of my laptop speakers go off. But I have an amplifier (5.1 channels) and I want to connect my laptop to it. (I use Windows too, and it use the realtek software to change the input line to output) I'm really a total newbie with everything related to sound (I apologize for that), but I even didn't found the answer in the wiki (or there is no answer over there or I really didn't understand).
    Thanks in advance for any help,  I will continue searching for the answer and posting in here if I succeed.
    what lsmod|grep '^snd' | column -t gave me:
    snd_hda_codec_hdmi     22092   1
    snd_hda_codec_realtek  294224  1
    snd_hda_intel          22122   1
    snd_hda_codec          77927   3  snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
    snd_hwdep              6325    1  snd_hda_codec
    snd_pcm                73856   3  snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
    snd_timer              19416   1  snd_pcm
    snd                    57786   9  snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
    snd_page_alloc         7089    2  snd_hda_intel,snd_pcm
    what ls -l /dev/snd gave me:
    total 0
    drwxr-xr-x  2 root root       60 Aug 21 15:01 by-path/
    crw-rw----+ 1 root audio 116,  7 Aug 21 15:01 controlC0
    crw-rw----+ 1 root audio 116,  6 Aug 21 15:01 hwC0D0
    crw-rw----+ 1 root audio 116,  5 Aug 21 15:01 hwC0D3
    crw-rw----+ 1 root audio 116,  4 Aug 21 15:01 pcmC0D0c
    crw-rw----+ 1 root audio 116,  3 Aug 21 15:01 pcmC0D0p
    crw-rw----+ 1 root audio 116,  2 Aug 21 15:01 pcmC0D3p
    crw-rw----  1 root audio 116,  1 Aug 21 15:01 seq
    crw-rw----+ 1 root audio 116, 33 Aug 21 15:01 timer
    what aplay -l gave me:
    **** List of PLAYBACK Hardware Devices ****
    card 0: Intel [HDA Intel], device 0: ALC270 Analog [ALC270 Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    Thanks in advance for any help you could provide me. I will keep searching for an answer
    P.D If it is possible, then it is possible to use the laptop speaker, input and output line to sound? (3 channels for that, it would be an 7.1 channels)

    Hi,
    What kind of invoice are you trying to change the account for, after you changed the "Allow Matching Account Override" option ? Was the invoice open and unaccounted then ? If an invoice was matched to PO a and accounted for before you changed this option, you won't be able modify the distribution of such an invoice. If this is in a test instance, try doing it for a new invoice first.

  • HTMLEditorKit and line wrapping

    If you feed some HTML to an HTMLEditorKit and then ask for the text back, HTMLEditorKit formats the text for you and, in particular, breaks it into smaller lines as it deems necessary. This can be very inconvenient, because you may end up with white space in unexpected places.
    Does anybody know of a way to prevent HTMLEditorKit from line wrapping?
    Here is a little program which demonstrates what I am talking about...
    import java.io.StringReader;
    import javax.swing.text.html.HTMLDocument;
    import javax.swing.text.html.HTMLEditorKit;
    public class LineWrap {
        public static void main(String[] args) {
            String text = "<html><body>This is some <b>HTML</b> text.  It is all " +
                "on a single line, unless somebody takes the initiative to wrap " +
                "it into several lines.</body></html>";
            try {
                HTMLEditorKit kit = new HTMLEditorKit();
                HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
                kit.read(new StringReader(text), doc, 0);
                kit.write(System.out, doc, 0, doc.getLength());
            } catch (Exception exc) {
                exc.printStackTrace();
    }The output looks like this:
    <html>
      <head>
      </head>
      <body>
        This is some <b>HTML</b> text. It is all on a single line, unless somebody
        takes the initiative to wrap it into several lines.
      </body>
    </html>

    I have no idea about it, but does this help?
    http://forum.java.sun.com/thread.jspa?threadID=298090
    Yes it does! You can prevent line wrapping by subclassing HTMLWriter and overriding the method canGetWrapLines() so that it always returns false.
    Thank you.

  • Multiple StringItems and line wrapping

    Hello!
    Why is it, that StringItems, that have to be line wrapped because of their length, cause the following StringItems to start at a new line after the preceding one, even if there is still enough room?
    Tested with WTK 2.5.1 (Qwerty Device)
    Here's an example:
    * ExampleMidlet.java
    * Created on 1. November 2007, 18:30
    package hello;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    * @author rp
    * @version
    public class ExampleMidlet extends MIDlet {
    public void startApp() {
    StringItem s1,s2,s3;
    Form form = new Form("Example");
    s1 = new StringItem(null,"That's just an example for a very long line, which has probably to be wrapped and a ");
    s1.setLayout(Item.LAYOUT_2);
    form.append(s1);
    s2 = new StringItem(null,"hyperlink");
    s2.setLayout(Item.LAYOUT_2);
    form.append(s2);
    s3 = new StringItem(null,", which is followed by even more Text");
    s3.setLayout(Item.LAYOUT_2);
    form.append(s3);
    Display.getDisplay(this).setCurrent(form);
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    Some real devices do this right, starting an item where the
    preceding one stops. Unfortunately lot's of others don't (following
    the WTK)
    Please!
    Do I really have to generate zillions of One-Word-StringItems in order to avoid ugly line wrapping ?
    cheers, Roland

    Please!
    Do I really have to generate zillions of One-Word-StringItems in order to avoid ugly line wrapping ?How about just one StringItem containing the entire text? Or would that create other problems?I have text with hyperlinks in between. That's why I cannot put it in one single StringItem.
    Device fragmentation. Nothing anyone can do about it.I don't think, device fragmentation is an argument here:
    Why should there be a layout directive like Item.LAYOUT_NEWLINE_BEFORE/AFTER
    if you shouldn't also have the possibility to have no line wrap at all?
    Here's what the API says:
    A row break occurs before an item if any of the following conditions occurs:
    the previous item has a row break after it;
    it has the LAYOUT_NEWLINE_BEFORE directive; or
    it is a StringItem whose contents starts with "\n";
    it is a ChoiceGroup, DateField, Gauge, or a TextField, and the LAYOUT_2 directive is not set; or
    this Item has a LAYOUT_LEFT, LAYOUT_CENTER, or LAYOUT_RIGHT directive that differs from the Form's current alignment.
    A row break occurs after an item if any of the following conditions occurs:
    it is a StringItem whose contents ends with "\n"; or
    it has the LAYOUT_NEWLINE_AFTER directive; or
    it is a ChoiceGroup, DateField, Gauge, or a TextField, and the LAYOUT_2 directive is not set.
    Neither there's a directive, that differs from the Form's current alignment, nor there's a newline in
    the StringItem, etc.
    So I guess,there shouldn't be a row break here.
    Thanks, Roland

  • Is it now possible with new version of Adobe Muse to create and HTML Newletter.

    I am in a bit of a rush because I have an e-blast to prepare for a customer and I was wondering if it is it now possible with new version of Adobe Muse to create an HTML newletter? I have never created an html newletter before, if it is not possible with muse, and I do not code, would mailchimp be the best choice. If it is possible with muse, would it be possible to please provide me with the steps or a tutorial?
    Thank you.

    The quick answer is, no. The output of Muse is designed to work with popular web browsers on desktops and devices. It relies on many features of HTML that are not supported by e-mail readers.

  • My mail stopped automatic line wrapping what's up?

    How do I get back to automatic line wrapping in mail?

    There is a setting under the Advanced tab for the
    account preferences to not keep all messages and
    their attachments available for offline viewing but I
    don't use this setting and don't experience the same
    problems.
    To clarify, do you mean that you "do not" keep all messages (etc.) available for offline viewing, or that you "do" keep all messages (etc.) available? At present, I have this option to "keep all messages and attachments available for off-line viewing" checked positive, by default I presume.
    After first creating the account if there
    are a number of server stored mailboxes and messages
    available on the server, the mailbox and message
    synchronization process takes longer than normal and
    the time it takes for subsequent synchronization
    should not be a real long process unless a number of
    changes have been make with server stored mailboxes.
    Odd thing is that I only have one saved message in the .Mac account, and that is a tiny weeny one (about 10K) with no attachments or anything! By the way, since I have just been going through everything all over again, I notice that what really seems to be holding things up (I've now changed synchronization to "manual" on both computers) is when I "Get Mail" and Mail is trying to open the .Mac mailbox - this goes on interminably (as I can see in Activity Viewer).
    Try using the Rebuild Mailbox function on all server
    stored mailboxes. All messages will disappear
    temporarily and the mailbox will be resynchronized
    with the server.
    Sorry for being dense, but I've been all over my Mail application and all over my .Mac settings and I can't find this "Rebuild Mailbox" function. Could you please tell me exactly where I can find this Rebuild Mailbox function?
      Mac OS X (10.4.9)  

Maybe you are looking for

  • How do you download Kindle book to iPhone 5s?

    I have many Kindle books I've purchased from Amazon; they are accessible to me on-line and I can download them at will to my Kindle.  But how can I download them to my Iphone 5s?

  • Can I share a Reminders list with someone else through iCloud?

    I am wondering if I can create shared lists with my wife (separate iTunes account) in Reminders on iPhone/iPad that we can instantly update through iCloud. We're essentially talking about grocery lists and the like.  (Yes, I know there are grocery ap

  • Lion & Downloading .pdf Files

    Since upgrading to Lion I can no longer see and download .pdf files from my bank and credit card company websites.  An empty window with a Quicktime symbol shows up.  A dialog box opens that says I need an add-on to "play" the file in Quicktime!  The

  • What are ancillary files associated with trash?

    Most of the items I put in the trash now produce a window which mentions ancillary files. What is the point if this extra window?

  • Limit vi hierarchy view

    I have a vi with 3 subpanels accessed via VI Server. I would like to see the VI Hierarchy for the top level VI only and not include the subpanels. Can this be done?