Getting the visible lines from a JTextArea

I'm using a JTextArea with a fixed size. I've used the setLineWrap(true) and setWrapStyleWord(true) methods on this JTextArea, so when the user types in some text longer than the visible width, it will wrap into the next line. I need to get each visible line from the JTextArea to create a String array of text lines.
I mean visible text lines (lines visibly separated in the JTextArea), not real text lines separated by a line break character as "\n".
How can I do this?

This information is supposed to be contained in the View information of the component. But as far as I can tell it doesn't work for a JTextArea.
So if you can use a JTextPane then check out the "getWrappedLines" method in this posting:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=608220
Basically, a View exists for each line in the Document and then each line may have multiple views if the line needs to wrap. So the basic code just count the number of views within each line but you can change the code to get each view separately. Once you have each view you can get the start and end of the text from the document that this View represents.
Or if you need to use a JTextArea then you can calculate the starting offset of each each line with respect to the model. You can use the viewToModel(..) method to get the starting offset of each line. We know that each line in a text area is a fixed height, so the starting offset of the first line would be modelToView(0, 0); If the line height is 16, then the starting offset of the second line would be modelToView(0, 16), etc. Once you know the starting offset of each line you can subString out the text for each line.

Similar Messages

  • Getting a single line from a JTextArea

    I have a JTextArea with a fixed size. I've used the .setLineWrap(true) and .setWrapStyleWord(true) on this JTextArea, so when the user types in some text, that's longer that the JTextArea, it will wrap unto the next line. I need to get each visible line from the JTextArea. That is not each line of text, that is seperated by a newline (when the user type Enter), but every line, that is visibly seperated in the JTextArea.
    How can i do that.

    The javax.swing.text.Utilities class can help:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class TestUtility extends JFrame
         public TestUtility()
              final JTextArea textArea = new JTextArea( "one two three four five", 5, 10 );
              textArea.setLineWrap( true );
              textArea.setWrapStyleWord( true );
              JScrollPane scrollPane = new JScrollPane( textArea );
              getContentPane().add( scrollPane );
              textArea.addCaretListener( new CaretListener()
                   public void caretUpdate(CaretEvent e)
                        int pos = textArea.getCaretPosition();
                        try
                             int start =  Utilities.getRowStart(textArea, pos);
                             int end =  Utilities.getRowEnd(textArea, pos);
                             System.out.println( start + " : " + end );
                        catch (BadLocationException ble) {}
         public static void main(String[] args)
              TestUtility frame = new TestUtility();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);

  • Read to get the last line from a File

    Hi
    I am sending in a clarification , hoping that I get an efficient solution from the group, should somebody have come across this scenario and implemented.
    How to read or get the last line from a text file , which usually have a no of records, without actually reading or looping through all the lines
    I know there is some solution with the RandomAccessFile, but given there can be some encoding issues or so.
    Please let me know if somebody have implemented the same.
    Thanks n advance

    The character encoding could, indeed, be an issue especially with UTF-8. I think what I'd do is to create a byte array with the encoded, expected end of line sequence in it and work on the file in bytes. For example, seek to the last 100 bytes of the file, read those bytes and look for an EOL sequence backwards. If not found read the previous 100, 200, 400 bytes etc. until you do find an end of line. Then seek to after the EOL and read normally. Remember an EOL sequence might cross a boundary.
    UTF-8 would be a problem, especially with a unix format file because you might mistake part of a multi-byte sequence for '\n'. To be reliable on UTF-8 you'd need to go back three characters looking for sequence start markers (has the previous character got the top bit set, or the one before that the first two bits set, or the one before that the top three bits). Or you could just react to an encoding exception and try another position.

  • How can we get the selected line number from JTextArea ?

    how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

    Praitheesh wrote:
    how can we get the selected line number from JTextArea ?
    textArea.getLineOfOffset(textArea.getCaretPosition());
    and want to insert line/string given line number into JTextArea??? is it possible ?
    int lineToInsertAt = 5; // Whatever you want.
    int offs = textArea.getLineStartOffset(lineToInsertAt);
    textArea.insert("Text to insert", offs);

  • Line Chart: It is possible to get the object reference from a flash chart

    Hi Folks,
    hope you feel well ...
    I wan't to get the Object Reference from a Chart Flash Object using javascript in the HTML Header of a Apex Page.
    It's long time ago with Oracle/Java and so my skills are really shity :-)
    The Functionbody works, but the following error occurs: chart.refresh is not a function
    It is necessary to CAST it ? with the Class AnyChart.js ?
    After 5 hours i give up ^^ is this kind of object handling possible ? THX4HELP@ll
    Apex Page HTML Header
    <script type="text/javascript">
    function hideSID2()
    var chart = document.getElementById("*c7067437546726610*");
    chart.refresh();
    </script>
    HTML File at runtime:
    <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    width="1400"
    height="600"
    id="c7067437546726610"
    align="top"> ...

    If you are using adobe Flex Builder to develop SWF, please be sure using ExternalInterface class to expose the refresh() method.
    then you can should be able to call this method in Javascript.

  • How to get the visible text in JTextField?

    I want to compare the space occupied by English and Japanese characters in the visible area of JTextFiled. I tried the same by taking the length of the characters occupied by the same text in both the language . But this did not work . I even tried the method getVisibleRect().
    Can please some one suggest a method or procedure by whcih i can get the length of the visible text in the JTextField
    Thanks
    Inder

    Point point = new Point(brm.getExtent(),0) ,it wont workWell, theoretically, the "Y" value shouldn't matter, but I guess when you display a line the text, the first couple of "Y" pixels are the spacing between lines and will presumably return the position of the character on the previous line (when using JTextArea, JTextPane). But since JTextField doesn't have a previous line I guess its returning 0. Change the "Y" value to 2 (1 doesn't work either):
    import java.awt.*;
    import javax.swing.*;
    public class Test
         public static void main(String[] args)
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              JTextField textField = new JTextField("Some text");
              frame.getContentPane().add(textField);
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
              for (int i = 0; i < textField.getSize().width; i += 5)
                   Point p = new Point(i, 2);
                   System.out.print(p + " : ");
                   System.out.println( textField.viewToModel(p) );
    }

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • Firming the schedule lines from MRP

    Hi All,
    I have a scenario where I generate the scheule lines from the total planning run for the material with the help of schedule line indiator = 3.
    I want these schedule lines should get automatically firmed. Which are the various ways by which I can do this?
    Regards,
    MHP

    Dear
    Using MRP Type with Firiming like P1 , P2 etc is the best way to deal with this situation .
    However , there is option in Schedule Line itself that u can give firming period and in that period schedule lines r firmed. Go to ME32L enter ur Scheduling Agreement Then select ur material and click on Additional Data (Shift+F5). There under Scheduling Control 'Firm Zone' field is there, try with this option and see what is sresult?
    If the date of a schedule line lies within the firm zone, the vendor has the go-ahead to produce the relevant quantity with the assurance that the orderer will bear any and all material and production costs associated with the scheduled quantity in the event of subsequent cancellation by the latter.
    1. Another way of handling your issue is by using the manual firming .
    2. In mdo4 in the Edit menu u will find a Set firming date.
    3. Now you can select this and this will give u a popup for entering a date.
    4.When u give a date in this and hit enter.
    Also please note delivery schedule lines in ME38 (even it is created automatically), in Planning time fence, will get affected by MRP run.
    Hope clear to you.
    Regards
    JH

  • Is there a way to get the correct order from the dependent types of a sche

    Hi ,
    I have a CT facing the following problem:
    When trying to built a SQL script to create all the object types within a schema using the DBMS_METADATA packages.
    Did insert in a table the names of the types that will be exported following a concrete order, next loop into the table and call the DBMS_METADATA package for each row.
    These type are depedent between them, there are some type attributes calling other types and here the issue
    First : try to generate the order by created column of dba_objects and when the generated SQL script is launched a lot of type appearing as incomplete state due to the order isn't correct.
    Second : try to insert the table ordering by object_id colums of dba_tables view, it appears incomplete types too.
    Currently want to insert the table using a recursive query with connect by against the dba_type_attrs starting with the rows when ATTR_TYPE_NAME is not null (the types that are called by other types), but this way has a issue dificult to resolve: the roots of hierarchy are the rows when ATTR_TYPE_NAME is not null and we've dependencies between roots nodes
    The question is is there a way to get the correct order from the dependent types of a schema?
    Platform: IBM SP AIX
    DB version: 9.2.0.7
    Any help will be appreciated .
    Thanks in advance.

    The xxx_dependencies view should give you the dependencies betwee nthe various types. I would look at something along the lines of:
    SELECT object_name, referenced_name
    FROM (SELECT o.object_name, d.referenced_name
          FROM user_objects o, user_dependencies d
          WHERE o.object_name = d.name(+) and
                o.object_type = d.type(+) and
                d.referenced_type(+) = 'TYPE' and
                o.object_type = 'TYPE')
    START WITH referenced_name IS NULL
    CONNECT BY PRIOR object_name = referenced_nameThe outer join between user_objects and user_dependencies is required to generate the names of types which are not dependent on other types, or do not have other types dependent on them.
    HTH
    John

  • How to get the Node Value from XmlValue result?

    Hi ,
    I am not able to get the Node Value from the result. In my XQuery im selecting till a Node, if i change my query as
    collection('PhoneBook')/phone_book/contact_person/address/string()", qc);
    im getting the node value, but here the problem is its not a Node so i cannot get the Node name.
    So how can i get the Node Name and Node value together?
    any help please ????
    XML :
    <?xml version="1.0" encoding="UTF-8"?>
    <phone_book>
    <contact_person>
    <name>
    <first_name>Michael</first_name>
    <second_name>Harrison</second_name>
    </name>
    <address city="yyyyy" pincode="600017" state="xxxxx">
    176 Ganesan street, Janakinagar, alwarthirunagar
    </address>
    </contact_person>
    <phone_number type="mobile">9881952233</phone_number>
    <phone_number type="home">044-24861311</phone_number>
    <phone_number type="office">080-12651174</phone_number>
    </phone_book>
    Code:
    XmlQueryContext qc = manager.createQueryContext();
    XmlResults rs = manager.query
    ("collection('PhoneBook')/phone_book/contact_person/address", qc);
    while(rs.hasNext()){
    XmlValue val = rs.next();
    System.out.println(val.getNodeName() + " = [ " + val.getNodeValue() + " ] ");
    Output
    address = [  ]

    You are right, this seemed un-intuitive to me too, but I finally understood how it's done.
    The "value" of a node is actually the total amount of text that is not contained in any of the node's child nodes (if any). So a node with child nodes can still have text value.
    To get the 'value' of an element node, you must therefore concatenate the values of all children of type "XmlValue::TEXT_NODE", of that node. Try it.
    In your example, the <address> node has no child elements, my guess is that BDB XML stores the address string "176 Ganesan street, Janakinagar, alwarthirunagar" inside a child node of <address> node (of type XmlValue::TEXT_NODE) because you wrote the string on a separate line.

  • How can you get  the public variables from object that extends JLabel?

    I'm using the mouseClickedListener method e.getComponent(); to get the component that is clicked on the sceen. The component i clicked is type "object" and extends a jlabel, and i really need to acces a variable from it. Heres the code i'm using-
    MouseListener listenerDown=new java.awt.event.MouseListener() {
            public void mousePressed(MouseEvent e){
                paintAll();
                mX=e.getX();
                mY=e.getY();
            public void mouseClicked(MouseEvent e) {
                Component c = e.getComponent();
                drawResizeBox(c);
                selected=c;
            public void mouseReleased(MouseEvent e) {
            public void mouseEntered(MouseEvent e) {
            public void mouseExited(MouseEvent e) {
    package javapoint;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.Line2D;
    import java.awt.image.BufferedImage;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    public class object extends JLabel{
        public object(Rectangle rect,int id){
            idNum=id;
            Rect=rect;
            BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = (Graphics2D) image.getGraphics();       
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g.drawRect((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight());
            Icon icon = new ImageIcon((Image)image);
            setIcon(icon);
            setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);
            mainFrame.slideArr[mainFrame.sIndx].add(this);
            setVisible(true);
            r=true;       
        object(Oval oval,int id){
            idNum=id;       
            setBounds(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            getGraphics().drawOval(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            o=true;
            setVisible(true);
        object(Line2D line,int id){
            idNum=id;       
            setBounds((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2()); //Not gunna work
            getGraphics().drawLine((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2());
            l=true;
            setVisible(true);
        object(Icon icon,int id){
            idNum=id;
            setIcon(icon);
            setBounds(50,50,icon.getIconWidth(),icon.getIconHeight());
            i=true;
            setVisible(true);
        void drawObject(object obj){
            if(r){
                Rectangle rect=obj.Rect;
                setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);          
                Rect=rect;
                BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = (Graphics2D) image.getGraphics();           
                g.setColor(Color.red);
                g.drawRect(0, 0, (int)rect.getWidth(), (int)rect.getHeight());           
                Icon icon = new ImageIcon((Image)image);
                setIcon(icon);
            }else if(l){
            }else if(o){
            }else if(i){
        public boolean r=false;
        public Rectangle Rect;
        public boolean o=false;
        public Oval Oval;
        public boolean l=false;
        public Line2D Line;
        public boolean i=false;
        public Icon Icon;
        public JLabel label;
        public int idNum;
    }Edited by: ghostbust555 on Feb 12, 2010 2:14 PM

    ghostbust555 wrote:
    Well see the problem is i have an array of 200 objects.What does that have to do with anything? And if it does, why isn't it in the code you posted?
    I dont understand what you mean in your "Edit..." part. could you show some code/ explain farther? sorry if its a dumb question I'm still a bit of a novice at java.Yeah.
    object yuck = (object) e.getComponent(); // That's a cast.
    boolean yucksR = yuck.r; // Get the "r" variable from the object.

  • How do I get the GidBagLayout location from my buttons?

    How could I get the location of my JButtons (or JLabels) in my GridBoxLayout?
    I've tried all that I could think of..
    here some code sample
    JButton button;
        GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
            c.weightx = 0.5;
            c.weighty = 0.5;
            c.insets = new Insets(20,20,20,20);
            button = new JButton("Button 1");
            c.gridx = 0;
            c.gridy = 0;
              button.addActionListener(this);
            centerPanel.add(button, c);
            button = new JButton("Button 2");
            c.gridx = 1;
            c.gridy = 0;
              button.addActionListener(this);
            centerPanel.add(button, c);
              System.out.println(((JButton)e.getSource()).getText());
              System.out.println(layout.getLayoutOrigin());
              //System.out.println(((JButton)e.getSource()).);
              //System.out.println(((JButton)e.getSource()).location());
              System.out.println(e.getSource().toString());
              System.out.println(layout.getLayoutDimensions());
    //          System.out.println(layout.lookupConstraints(((JButton)e.getSource())));
              System.out.println(layout.getLayoutOrigin());I think that's all you experts would need..
    what I'm trying to do is when I click on one of them buttons then fetch where that buttons is (in the GridBagLayout, not absolute) and be able to add a new button to the side or under the clicked button..
    the System.out.println(layout.getLayoutOrigin()); does seem to give me x=0 and y=0 but that's the same with all buttons so it isn't good enough

    I think that's all you experts would need..You would think wrong. We need a SSCCE to see exactly
    what you are doing.
    see http://homepage1.nifty.com/algafield/sscce.html,
    In general component don't have a size or location
    until the GUI is visible. That is the layout manager
    isn't invoked until the component is displayed.
    If you want to add a component after the component
    you click on then you would probably need to use the
    add(...) method that takes a position variable as a
    parameter.yes I think I need to use the add(..) and a position variable
    the problem is that I need to get the position variable from the other component so I could put the new component at the right position
    as for the SSCCE I do think that I do that..
    but for some extra information
    I'm writing an applet.. and I use a borderlayout for some component.. in the center panel I've placed a GridBagLayout and some buttons.. I've given the buttons an ActionListener and now I want to get the location in the GridBag of the Button I've pressed
    so when I click one of them buttons I want to know it's location.. as in X=1, Y=2 or something
    so I could place the new button on X=1, Y=3

  • How to get the Converted opportunities from the lead extension BO?.

    Hi Experts,
    In Sales lead after converting to opportunity, it will appear in opportunity sub facet in lead. How to get these opportunity in ABSL script file.
    Technically: In opportunity business object what should i pass to get this converted opportunity from the extension Lead BO.
    If i pass Account ID to the opportunity BO, i am getting more than one opportunities.
    Can you please tell me what are the common and unique field to pass to opportunity BO for getting the corresponding opportunity from the lead extension BO.
    Regards,
    Vijay.

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • When I open Safari, I keep getting the Jobs video from Tim. Once was OK.ow do I turn it off?

    When I open Safari, I keep getting the Jobs video from Tim. Once was OK.ow do I turn it off?

    First, go to the website that you wish to make your Home page.  Then click on Safari>Click on Preferences on the dropdown menu>Click on the "General" tab on top of the window which should be on your screen>click on the "Set to Current Page" button which is under the Home Page line.  This should solve the problem.

Maybe you are looking for

  • Can we perform two actions with one button with two clicks one after other?

    Sir, can we perform two actions with one button with two clicks one after other? I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields. Regards Tanvir

  • How do you make itunes not play wav files?

    I know how to make it play wav files but how do I remove it from the default player list? I want them to all play in Quicktime. I have done the right click, holt alt and press Always Open With... and also done the right click and specify it to open i

  • Home page lacks toolbars(file..back..address)

    My comcast home page does not have toolbars (file,edit...; back..home..; address) when using Firefox. (It has them when using IE). Otherwise everything works including e-mail. == This happened == Every time Firefox opened == about a week ago

  • Role Provider Error

    I am just starting to use the providers. I call the following code from a button. MembershipUserCollection users = Membership.GetAllUsers(); foreach (MembershipUser mu in users) bool inRole = Roles.IsUserInRole(mu.UserName, "testrole"); I have 4 user

  • DVD Importing Error

    Hi, I'm using Adobe Premier Elements 4 and am trying to import a DVD that I have filmed myself and am getting Error Unsupported format or damaged file/One of the necessary components may not have been installl... There are no updates to install, and