Runtime Error in JTable with JTableModel Implementation

Hi,
I tried to do a JTable (named "table) in my program, with an implementation of JTableModel, called DataContent (obj named "dc"). Now if I try to change dc's data and refresh the table in the window by doing a "table.setModel(dc);", my programm gives me just runtime errors.
class MyFrame extends JFrame implements ActionListener{
// This is the class of the JFrame which contains the table
// globally defined vars:
private DataContent dc;
private final JTable table;
// in someMethod(){
public MyFrame(){
// creates, inits and draws the table into the window - this works !
     JPanel jpPreview = new JPanel(new GridLayout(1,0));
     dc = new DataContent();
        table = new JTable(dc.getTableData(), dc.getCol());
        table.setPreferredScrollableViewportSize(new Dimension(500, 40));
        table.setBorder(borderPanel);
        jpPreview.add(table);
     jpSeparator.add(jpPreview);
public void actionPerformed(ActionEvent ae) {
// in the same class
          if(ae.getSource() == butLoadPath){
               // choose a path by clicking on a button "butLoadPath"
               szPath = sg.readPath();
               labelLoadPath.setText(szPath);
               dc.setPath(szPath);
               dc.setContent(szToken);
          }else if(ae.getSource() == butSeparator){
               // choose a different separator token by JRadioButtons
               // when someone clicks on the button butSeparator,
               // the table should be refreshed, with this function:
               setPreview();
          }else...
private void setPreview(){
          // reads out which option was chosen by the radiobuttons - this works
          // refreshes the Object[][] oData in dc - this works, too
          dc.setContent(szToken);
          // this should refresh the table obj in the JFrame,
          // this gives me some Null.pointer.exception - why ?
          table.setModel(dc);// ??? P R O B L E M ???
     }I have implemented the Interface DataContent like this:
public class DataContent implements TableModel{
     // vars
     private int iRow,iCol;
     private String szInputData = "";
     char cToken, cLineLimiter;
     private Object[][] oData;
     // ctor
     public DataContent(){
          reset(); // set Elements...
     public void setPath( String szPath){          
          // read line from file obj...
     private void reset(){
          // set up an epmty set of data in the table...
     public void setContent( String szToken){          
          // separate content of szInputData by szToken and set oData...
     public Object[][] getTableData(){
          // return oData...
     public String[] getCol(){
          // gives some name for each column...
////////////////////////////////// automatic generated for the implementation of the interface JTableModel /////////////////
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#getRowCount()
     public int getRowCount() {
          // TODO Auto-generated method stub
          return iRow;
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#getColumnCount()
     public int getColumnCount() {
          // TODO Auto-generated method stub
          return iCol;
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#getColumnName(int)
     public String getColumnName(int columnIndex) {
          // TODO Auto-generated method stub
          String[] szColumnName = getCol();
          return szColumnName[columnIndex];
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#getColumnClass(int)
     public Class getColumnClass(int columnIndex) {
          // TODO Auto-generated method stub
          return null;
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#isCellEditable(int, int)
     public boolean isCellEditable(int rowIndex, int columnIndex) {
          // TODO Auto-generated method stub
          return false;
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#getValueAt(int, int)
     public Object getValueAt(int rowIndex, int columnIndex) {
          // TODO Auto-generated method stub
          return oData[rowIndex][columnIndex];
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
     public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
          // TODO Auto-generated method stub
          // NO editing !
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#addTableModelListener(javax.swing.event.TableModelListener)
     public void addTableModelListener(TableModelListener l) {
          // TODO Auto-generated method stub
     /* (non-Javadoc)
      * @see javax.swing.table.TableModel#removeTableModelListener(javax.swing.event.TableModelListener)
     public void removeTableModelListener(TableModelListener l) {
          // TODO Auto-generated method stub
}I tried to implement some of the automatic generated methods, without success, still the same problem. What can I do, that...
table.setModel(dc);
...works without probs ???
Is there a better way to do this - the table should not even be editable, just to be shown in the window, to give an impression ??
THX

Why are you creating you own TableModel. Use the DefaultTableModel its easier. If you don't want you cells to be editable then you just do this:
JTable table = new JTable(...)
     public boolean isCellEditable(int row, int column)
          return false;
};

Similar Messages

  • Runtime error Outlook.exe with Acrobat 7.0.9

    I use Acrobat 7.0.9 professional with Office 2000. When using Outlook I get often messages "Microsoft Visual C++ runtime library Runtime error! Program: X:\Apps\Microsoft Office\Office]Outlook.exe This application has requested the Runtime to terminate it in a unusual way. Please contact the application's support team for more information."
    This error message shows up after deleting a message. Not always. The operating software is Windows XP.

    1 - the latest is 7.1
    2 - microsoft has one (maybe two) runtime fixes
    go to http://search.microsoft.com/search.aspx?mkt=en-US&setlang=en-US
    search for the text of the error message, or "something like"
    runtime update
    and follow the links to find the download

  • Runtime Error building Installer with NI-VISA Runtime

    Greetings,  I'm getting this error whenever I check the "NI-VISA Runtime" option in the installer app builder.
    Everything builds fine when I check only the Runtime Engine.  Shown below is what causes the RUNTIME ERROR and closes Labview Unexpectedly.
    Any help you could provide would be very much appreciated.
    Regards,
    JD

    Hi JD,
    This is a relatively common error with the Application Builder that can happen for several different reasons, namely registry keys pointing to installations that no longer exist. The easiest way to identify the problem is to get detailed information about the installer build. Here are directions:
    LabVIEW has the
    ability to create a very detailed log of the events that occur when
    building an application or installer. To enable this feature, open up
    the LabVIEW.ini file and copy "CDK.EnableLog=true" to the bottom
    of the file. Save the changes and close the ini file. The LabVIEW.ini
    file is usually located in C:\Program Files\National
    Instruments\LabVIEW X.X
    Enabling this feature will create a log file in the %temp% directory of your computer (%...% means a computer variable) .
    To
    find out where this temp directory is located, go to Start>>Run.
    Type in "cmd". Then type "set". This will return all of your computer's
    variable names.
    Look for TEMP in the list of variable names. You should see something like "TEMP=C:\DOCUME~1\user\LOCALS~1\Temp".
    Navigate to this directory using Windows Explorer.
    You
    should see a file named "Name.log" where "name" is the name of your
    build specification. For example, you might see "My Installer.log" if
    the name of your build specification is "My Installer".
    This will give you a more detailed log of the attempted build and, if I'm correct about why this particular build failed, show you which installer is expected at that registry. If the registry points to a directory without the necessary installer (i.e. VISA), simply delete the registry and allow the App Builder to prompt you to to point to the correct location.
    Michael K.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • Getting "warning" -- "Late bound resolution, runtime errors could occur" with a line referencing a Word document

    The problem line is:
                Dim Author$ = wd.ActiveDocument.BuiltInDocumentProperties(WdBuiltInProperty.wdPropertyAuthor).value.ToString
    "wd" is my program's instance of Microsoft Word.
    I've encountered this error before and could always fix the program and get rid of the warning without having to enclose the line in a "Try..Catch" structure. I enclosed this line in a Try..Catch, but the warning still appears, and for some reason,
    I have dedicated my few remaining years to getting rid of it.
    Robert Homes

    Armin:
    That didn't work for me. I couldn't even compile it like that, and I changed it to:
    =============================================
            Dim props As Microsoft.Office.Core.DocumentProperties = _
                    DirectCast(wd.ActiveDocument.BuiltInDocumentProperties, _
    Microsoft.Office.Core.DocumentProperties)
            Dim Author$ = props(WdBuiltInProperty.wdPropertyAuthor).Value.ToString
    =============================================
    That at least allowed me to compile (and DID get rid of the warning), but then I got a runtime error:
    ========================================================
    An unhandled exception of type 'System.InvalidCastException' occurred in Share.exe
    Additional information: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}'
    failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    ================================================================================
    Robert Homes

  • Runtime Error on XP with Outlook 2010

    I get Runtime errors too.
    When i want to open an PDF in my Office 2010 Outlook then i get a runtime error.
    Whats to do?
    Greets
    Olaf

    A good idea would be to search for this problem in discussion forums (such as this one) and also to reinstall both Outlook and Adobe Reader to see if this resolves the problem.
    John
    http://www.ep1c-gaming.co.uk

  • Runtime error: UFL 'u25total.dll' that implements this function is missing

    Has anyone seen this error when printing reports at runtime?
    HandlingInstanceID: 34db0437-5151-48f1-b737-8aa06b53a7ed
    An exception of type 'System.Runtime.InteropServices.COMException' occurred and was caught.
    11/14/2008 09:03:20
    Type : System.Runtime.InteropServices.COMException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : UFL 'u25total.dll' that implements this function is missing.
    Source : Crystal Reports ActiveX Designer
    Help link :
    ErrorCode : -2147191835
    Data : System.Collections.ListDictionaryInternal
    TargetSite : Void PrintOut(System.Object, System.Object, System.Object, System.Object, System.Object)
    Stack Trace :    at CRAXDRT.ReportClass.PrintOut(Object promptUser, Object numberOfCopy, Object collated, Object startPageN, Object stopPageN)
    We develop our reports in CR Developer Product Type: Full version 11.5.8.826 and the main application is a windows .net C# application. At our branch locations we have CR XI2 SP3 installed. Currently we have our application at over 400 locations and this error keeps coming up sporadically. Once the users click through the error and print again they have no problems. I haven't been able to reproduce this error so any help would be very much appreciated.

    Don,
    I talked this over with my team members here is what we are going to try. We are going to add mutex around our print code that contains the following:
    CRAXDRT.ApplicationClass reportApplication = new CRAXDRT.ApplicationClass();
    CRAXDRT.Report legacyReport;
    After adding the mutex to the code we still received an exception. So in the interest of trying to free up the resources associated to that DLL we added the following inside of the mutex after the print code.
    reportApplication = null;
    legacyReport = null;
    GC.Collect();
    GC.WaitForPendingFinalizers();
    After doing that I havenu2019t been able to reproduce the problem. Is there anything else in the com objects that could be holding that resource open.

  • Runtime error in linking with static variables....

    Hi,
    I am building a shared library which includes a compiled object generated from a class containing the static variables only and also I have another version of same class with same & some new static variables in it and using that to generate another shared library. Now when I tried to run a program
    which links with both the library it core dumps when it tries to return from the program i.e when it finishes.
    Can someone please help me explain why my program is behaving like that?? Can duplicate inculsion of static variables in different scope can cause problem ?? How can this be avoided ?
    Also please be advised that the class with static variables gets generated at the compile time using a script which uses a DTD whose version (specification) can be different in both the libraries therefore I can't just seperate the common stuff into one class and specific into another.
    Thanks.
    Rajeev.

    Not to worry...found the answer in another post. Seems like patches need to applied to the OS.

  • Reg : USMM Abap runtime Error

    Dear Friends,
    Greetings, I got ABAP runtime error in tcode USMM after implement the oss note 1150840  correction.
    ERROR is SYNTAX_ERROR
      Syntax error in program "RSUVM000 " this program unfortunatley can not be executed.
    The following syntax error occurred in program "RSUVM000 " in include "RSUVMINC  " in line 1605
    "The type "SX_ADDRESS" is unknown."
    ECC 6.0 with SQl Server 2005 and windows 2003 server
    Pls give suggession to me friends
    Regards
    keshav

    Hi Subash,
    Basis Patch level is SAPKB70013, ABAP KA70013.
    Now we have plan to updation of patches. Before that SAp asking USMM(User Measurement report) so i can execute USMM report.
    what can i do now?
    Regards
    kesav

  • Runtime Error while opening the transaction ME22N

    Hi,
       when am trying to open the transaction ME22Nin Ecc6.0 its showing the runtime error like Assign with Length 0 in the pgm SAPLTAX1 in the Module FIND_TAX_SPREADSHEET.
    than you in advance.

    post your Dump information with           
    Short text
    What happened?

  • RSIMPCURR: Runtime error while executing

    Hi Everyone,
    I want to create a process chain to transfer global settings from my ECC system to the BI system. For this purpose I was checking the ABAP program RSIMPCURR which is used to transfer the currecny exchange rates. But when this program is executed, it throws a runtime error and ends with a dump.
    Here's a snippet of the ABAP dump:
      151   CALL FUNCTION 'RSAR_DESTINATION_GET'                                                      
      152     EXPORTING                                                                               
    153       i_logsys      = l_source                                                              
      154     IMPORTING                                                                               
    155       e_destination = l_destination                                                         
      156     EXCEPTIONS                                                                               
    157       not_exist     = 1                                                                     
      158       OTHERS        = 2.                                                                    
      159   IF sy-subrc <> 0.                                                                         
    ' >>>>>     MESSAGE x000(rh).                                                                       
      161   ENDIF.                                                                               
    162                      
    The thing is, when I manually transfer the currencies from the RSA1 > Source system screen, I'm not facing any issues. Its only while executing the program that I get the dump.
    Any suggestions?
    Thanks,
    Ram

    Hi,
    I don't think this is a resource issue, because the global settings get transferred when I do it from RSA1 > Source system.
    Also the FM 'RSAR_DESTINATION_GET' is the one that throws the exception 'Cannot find destination'. I think this is because I cannot enter the Source System in the program parameters because it is disabled. The other parameters (like 'Exchange Rate type' and 'Changes since') are not disabled and I'm able to enter the selections into those.
    Is there anyway that I can enable the source-system box and provide my source system as a location extract the currencies?

  • Unable to interpret "650.00u00A0 " as a number. Runtime Error : CONVT_NO_NUMBER

    Hi ,
    This is a issue which has to be resolved ASAP as all the checks are being thrown Dump in Production.
    It would be great if any of you could help me in this regard.
    I have been encountering a runtime error as "CONVT_NO_NUMBER" with
    short text as "Unable to interpret "650.00  " as a number."
    System versio : SAP ECC 6.0
    The problem is occuring at the below code
        FORM XXXXXXXX TABLES t_XXX_in  STRUCTURE itcsy
                                       t_XXX_out STRUCTURE itcsy.
          DATA: $_swnet     LIKE regud-swnet.
          DATA: $_rwbtr     LIKE reguh-rwbtr.
          DATA: $_zbukr     TYPE bukrs.        
          READ TABLE t_XXXX_in WITH KEY 'REGUH-RWBTR'.
          CONDENSE t_XXXX_in-value NO-GAPS.
    make sure the amount field is an amount.
          IF t_XXXX_in-value CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
            $_rwbtr = 0.
          ELSE.
    >>>>>     $_rwbtr = t_XXXX_in-value.
          ENDIF.
    Can you please help me in this regard.
    regards,
    bhima
    Moderator message: number formatting questions = FAQ, please search before posting, do not use the term "ASAP", all threads have the same priority.
    Edited by: Thomas Zloch on Nov 17, 2010 6:19 PM

    This is a FAQ. Please search before posting.
    Just to avoid dump catch the exception cx_sy_conversion_no_number . But you have to do some other changes like replacing the unwanted characters like comma,dot etc and then move it.

  • Runtime Error While in Tcode KES1

    Hello Team,
    We are using ECC6 EhP6.
    I am getting a Runtime error while working with Tcode KES1:
    Short text
              Syntax error in program "SAPL0KEA ".
         What happened?
              Error in the ABAP Application Program
              The current ABAP program "SAPLSVIM" had to be terminated because it has
              come across a statement that unfortunately cannot be executed.
              The following syntax error occurred in program "SAPL0KEA " in include "L0KEAT00
    " in
              line 225:
              "The Dictionary structure or table "*T2580" is either not active or doe"
              "s not exist."
              The include has been created and last changed by:
              Created by: "GAURILAD "
              Last changed by: "SAP* "
              Error in the ABAP Application Program
              The current ABAP program "SAPLSVIM" had to be terminated because it has
              come across a statement that unfortunately cannot be executed.
         Error analysis
              The following syntax error was found in the program SAPL0KEA :
              "The Dictionary structure or table "*T2580" is either not active or doe"
              "s not exist."
         Please help me resolve this issue
    Thanks
    Saheli

    Hi Dnyaneshwar,
       Please execute report RKEAGENV  and regenerate operating concern and check if the issue is resolved.
       If not run report RKEAGENF with your operating concern, type of COPA = 1 (costing based) and flag the 'Refill' option. Regenerate the operating concern.
    If running report RKEAGENV will cause another error concerning   operating concern E_B1,then please follow the steps in KBA note  1514122
    Operating concern should be E_B1 even though you may not be using this operating concern.
    regards
    Waman

  • Receive 'runtime error: Unknown exception' w/99% processed when creating DVD from movie

    Hi,
    I have tried several times to create a DVD of a movie with several Scene (w/Stop) Markers only to receive 'runtime error: Unknown exception' with 99% completion.
    I'm using Adobe Premiere Element 11 ver 11.0 (20120901.B261.425551).
    I'm running Windows 7 Ultimate w/SP1 on a Dell XPS M1530 w/4GB Memory
    I have created DVDs in the past with little or no problems.
    Would appreciate any help with my problem.
    Thanks...

    Harry
    Thanks for the additional information.
    Typically, if you are doing a multi movie Timeline and you want the viewer to be able to navigate to a specific movie followed by return to main menu, then:
    Main Menu Marker at beginning of movie 1 and Stop Marker at end of movie 1....then gap of at least 12 frames...Main Menu Marker at beginning of movie 2 and Stop Marker at end of movie 2....and so on. But for the last, remember no Stop Marker at the end of that last Movie on the Timeline.
    With those 25 .mts video clips, are you sure that you want or need all those return to main menu possibilities.... a scene marker at the beginning of each and a stop marker at the end of each for a return to menu after each of the 25 video clips? Especially if these are small video clips.
    Large project...
    Keep in mind that the DVD disc 4.7 GB/120 minutes is in reality 4.3 GB capacity. So as you can tell my the program's lowering of the Bitrate (8.00 to 7.97 Mbps), the program is trying to make the fit by lowering the bitrate. Depending on how your troubleshooting goes, you may want to start thinking about DVD Double Layer Disc (8.5 GB/240 min) if your project gets much larger. In the case of the DVD double layer, 8.5 GB is in reality 7.3 GB. Typically, lower the Bitrate, the lesser is the Quality of the end product. So you do not want to force the program to lower the Bitrate to low to make the fit.
    As for the Timeline - + slider to which I referred...
    In the above screenshot, please note in the right side of the Premiere Elements 11 Timeline (Expert view)...from left to right at that location,
    the Render Button
    the icon named "Fit to Visible Timeline
    the icon named Zoom Out ( - ) which is related to the slider to its right
    the icon named Zoom In ( +) which is related to the slider to its left
    That slider is moved by either of those icons or by moving the circular button of the slider with the mouse curser.
    We will be watching for further developments.
    Thanks.
    ATR

  • ICloud Control Panel Runtime Error

    Hello,
    The Apple update service carried out an update yesterday to the latest versions of iTunes and iCloud Control Panel on my Windows 7 Toshiba notebook. Following the (requested ) reboot, all attempts to log into the iCloud Control Panel result in a Microsoft Visual C++ Runtime error, code R6034 with a message to contact the application's support team for more information.
    If I OK all the error messages, (three times), it finally logs into the iCloud server.
    I have uninstalled and re-installed the latest version of the Control Panel software, but the result is the same.
    Short of going back to the previous version, are there any workrounds that I can try in order to resolve this.
    Thanks
    Ian B

    I have the same problem with windows 8.1. This is very annoying. The error pops up on every boot.

  • Depreciation Key - Runtime error

    Hi everyone,
    In AS02, in depreciation area, I was trying to change depreciation ket assignment. By default it is coming 0000, when I am tring to select some other dep key, it goes into runtime error.
    I am getting following message. Please guide me.
    Runtime Errors         ASSERTION_FAILED
    What happened?
        In the running application program, the ASSERT statement recognized a
        situation that should not have occurred.
        The runtime error was triggered for one of these reasons:
        - For the checkpoint group specified with the ASSERT statement, the
          activation mode is set to "abort".
        - Via a system variant, the activation mode is globally set to "abort"
          for checkpoint groups in this system.
        - The activation mode is set to "abort" on program level.
        - The ASSERT statement is not assigned to any checkpoint group.

    Hi,
    what is your support package stack for software component EA-APPL?
    Have you searched for notes already? You find several ones where this runtime error goes along with the new depreciation calculation functionality as of ECC 6.0.
    Regards,
    Markus

Maybe you are looking for

  • How can I use Pinnacle break-out box to capture in CS5

    A colleague uses Pinnacle's break-out box to capture analog video directly through CS4, bypassing Studio. I have CS5, and bought Pinnacle Studio 14. But when I open CAPTURE in CS5, I get a "capture device offline" statement. Anyone got any ideas? CL

  • Pre-Populating Text fields from a Data drop down list using SQL Server

    I'm currently trying to update some of our internal forms which are word based or a basic PDF form you fill in by yourself. I'm connecting to our SQL server as there are databases stored there for an internal bit of software that hold information I c

  • Adding field in standard report

    Hi, I have copied the standard table RM07MLBD(T-code MB5B) into Z-Report.  Now, i have to add a field LSMNG into the list output of the report. How to do that.? Plz help.!

  • Reading a file via tcp/ip

    I have used the open application reference and the open vi reference with the invoke node to remotely activate a vi and this works fine. The vi on the remote comuter creates an output file which i then need to get onto the local computer and I am uns

  • Embedding Swing Components within Javafx Scene (on a Mac)

    Currently I trying to embed swing components into javafx through steps located here: SwingNode The Myth not the reality | In-SideFX Was able to get it working on a PC, however when the packaged jar is run on a mac, I end up with the "Headless excepti