Connecting GUI & Application - Page 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28

Thread: Connecting GUI & Application

  1. #16
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Hopefully, you are using some class that extends AbstractTableModel. There is no method to refresh an AbstractTableModel.

    You can update a TableModel one cell at a time using the setValueAt(...) method.

    You can create a new TableModel and then update the table using the setModel(...) method.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  2. #17
    Join Date
    Jan 2008
    Posts
    29
    Haha i have JUST been able to update the rows as packets are captured using the method fireTableRowsInserted(int firstrow, int last row) found in the abstracttablemodel class!!
    Well my mainclass inherits from the abstracttable model and implements TableModel!

    sample code..
    fireTableRowsInserted(arraylist.size()-1, arraylist.size()-1);

    Well that was just by trial & error type....

    it's just need a little tweak and it will be just fine!!

  3. #18
    Join Date
    Jan 2008
    Posts
    29
    Me again...well i just hit another wall

    Having been able to capture the packets and display that on a GUI...Its already Huge for me!!

    Well does anyone knows how to break the RAW packects captured using JPCAP into the following info
    - source ip
    - dest ip
    - protocol/ port num
    - data

    Here is a sample RAW packets using jpcap

    null
    1199732909:112304 /72.5.124.55->/196.192.105.210 protocol(6) priority(0) hop(44) offset(0) ident(45717) TCP 80 > 1054 seq(1408407345) win(34080) ack 535793793 F P
    1199732909:112304 /196.192.105.210->/72.5.124.55 protocol(6) priority(0) hop(128) offset(0) ident(412) TCP 1054 > 80 seq(535793793) win(64940) ack 1408407941
    1199732909:112304 /131.246.120.27->/196.192.105.210 protocol(6) priority(0) hop(44) offset(0) ident(207) TCP 21 > 1053 seq(3402127996) win(5840) ack 3714687875 P
    1199732909:112304 /196.192.105.210->/131.246.120.27 protocol(6) priority(0) hop(128) offset(0) ident(413) TCP 1056 > 44460 seq(292781250) win(65535) S


    hmmm if anyones have an idea..PLEASE....

  4. #19
    Join Date
    Jan 2008
    Posts
    29

    Error

    hey guys just got an error while trying to make the code a little bite tidy.

    Size of array 97
    1203664397:755973 /80.239.236.118->/192.168.1.10 protocol(6) priority(0) hop(43) offset(0) ident(49943) TCP 80 > 3933 seq(3948788056) win(6432) ack 410454877
    Size of array 98
    Exception in thread "AWT-EventQueue-1" java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    at java.util.AbstractList$Itr.next(Unknown Source)
    at java.util.AbstractCollection.toString(Unknown Source)
    at javax.swing.table.DefaultTableCellRenderer.setValue(Unknown Source)
    at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(Unknown Source)
    at javax.swing.JTable.prepareRenderer(Unknown Source)
    at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
    at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
    at javax.swing.plaf.ComponentUI.update(Unknown Source)
    at javax.swing.JComponent.paintComponent(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JViewport.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
    at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
    at javax.swing.JComponent._paintImmediately(Unknown Source)
    at javax.swing.JComponent.paintImmediately(Unknown Source)
    at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    1203664397:803797 /80.239.236.118->/192.168.1.10 protocol(6) priority(0) hop(43) offset(0) ident(49944) TCP 80 > 3933 seq(3948789508) win(6432) ack 410454877
    Size of array 99
    close:0
    #
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x03e68455, pid=3576, tid=3512
    #
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
    # Problematic frame:
    # C [wpcap.dll+0x8455]
    #
    # An error report file with more information is saved as hs_err_pid3576.log
    #
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    #
    i get that message each time. What i did waz to pass the arraylist as parameter to the main class, then i got all these error messages!!! And also i get "Exception in thread "AWT-EventQueue-1" " at specific array location, for example at location 98 in the above quote!!

    It works fine when no arraylist was passed as parameter.

    Can anyone help please.....!!!!

  5. #20
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    What happens when the arraylist keeps below 50 or 90 elements?

  6. #21
    Join Date
    Jan 2008
    Posts
    29
    The error still here


    Size of array 48
    null
    Size of array 49
    close:0
    #
    # An unexpected error has been detected by HotSpot Virtual Machine:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x03e78455, pid=480, tid=4020
    #
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
    # Problematic frame:
    # C [wpcap.dll+0x8455]
    #
    # An error report file with more information is saved as hs_err_pid480.log
    #
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    #

    and i don't get the "Exception in thread "AWT-EventQueue-1" java.util.ConcurrentModificationException" error.

    The application just worked fine before i tried to implement another class to pass the arraylist....from my main class to another class where the table is created and populated!

  7. #22
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    This will explain what is probably going on.

    http://java.sun.com/j2se/1.4.2/docs/...Exception.html

    Two processes are trying to seize control (to protect you from yourself) of the arrayList. One object is trying to add items to the list while another object is iterating through the list. Think about passing a copy of the arrayList to your Table "for reporting purposes", while leaving access to the arrayList itself to the class which is processing the packets.
    Last edited by nspils; 02-22-2008 at 06:45 AM.

  8. #23
    Join Date
    Jan 2008
    Posts
    29
    Hey thanks mate..that worked !!!

    Hmmm application stops to respond after some time....Well that's just another problem..it's still the arraylist messing around....!!!

    Edit: Just come accross hashmaps
    http://java.sun.com/j2se/1.4.2/docs/...l/HashMap.html

    Hmm that's alien english..can anyone brief me a little on hashmaps in terms of simple english...please..!!!
    Last edited by null_guy; 02-24-2008 at 06:45 AM.

  9. #24
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Does this help?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  10. #25
    Join Date
    Jan 2008
    Posts
    29
    hmmm not much!
    Last edited by null_guy; 03-02-2008 at 12:32 PM.

  11. #26
    Join Date
    Jan 2008
    Posts
    29
    So far i have been able to get the original len and display that on the table. i want to extract the source,destination addresses & the protocol from the packet captured!

    Can anyone tell me about these 4 variable (found in the link
    http://yuba.stanford.edu/vns/clack/j...netParser.html
    1) typeStart
    2) typeLen
    3) dataStart
    4) dataLen

    thks

  12. #27
    Join Date
    Jan 2008
    Posts
    29
    Elo guys, my program is almost complete. Does anyone know how to convert the java files to .exe ones.

    Thanks!

  13. #28
    Join Date
    Jan 2008
    Posts
    29

    convert to jar...

    poping the thread again!!!

    hey guys my application is finally complete..and runnig good without errors..!!

    i'm trying to convert the application into executable jar files....

    from cmd..:
    Code:
    jar test/MyApplication.jar test/manifest.txt test/Trials_Ones/GUI/*.classes
    a jar file is created and whenever i try to run the MyApplication.jar, i get the follow error..

    Failed to load Main-Class manifest attribute from c:\test\MyApplication.jar
    here is my manifest.txt file.
    Main-Class: new_appli
    where new_appli = my main class..

    can anyone help me to get that jar file working ...

    Thks!!

Similar Threads

  1. Replies: 0
    Last Post: 06-15-2005, 07:31 PM
  2. One Application to Control Many
    By mythol in forum .NET
    Replies: 1
    Last Post: 05-19-2005, 05:14 PM
  3. Replies: 13
    Last Post: 10-23-2001, 01:37 PM
  4. Replies: 1
    Last Post: 04-14-2000, 10:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center