• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which Swing Component to Use to view log file ??

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everybody

I want to view the log file in Unix OS.Normally we use tail command to view
the log file contents dyanmically (as the log file changes, it shows the latest change to that log file).
Basically i want to simulate the same thing with Swing component.
Kindly let me know which component i can use.. more like editor where i would give the file to be viewed..It should be dynamically show me the content of the log file.

Shed some light on this.I would really appreciate
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe JList. You could either use its setListData method to give it a list of the messages to display, or work explicitly with a ListModel via the setModel method.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Craig!

I used a JTextArea with editable set to false. As each line is read from the file you just need to call JTextArea.append(theLine);

Hope that helps!

Darrin
 
reply
    Bookmark Topic Watch Topic
  • New Topic