Results 1 to 4 of 4
  1. #1
    Ami
    Ami is offline Member
    Join Date
    Feb 2012
    Posts
    26
    Rep Power
    0

    Default How can I display file (different formats) within my GUI?

    Hi

    I would like to be able to open and display files within my GUI without knowing the format in advance. For example, they can be images or text or tables from a database.

    I'm not sure how to do this. I can't display them in a JTextArea because they may not necessarily be text files.

    Can anyone help?

    Thanks

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: How can I display file (different formats) within my GUI?

    You'll need to have some logic somewhere to decide what the file is.
    Please do not ask for code as refusal often offends.

  3. #3
    Ami
    Ami is offline Member
    Join Date
    Feb 2012
    Posts
    26
    Rep Power
    0

    Default Re: How can I display file (different formats) within my GUI?

    Thanks

    would I not just be able to display that file on a JPanel?
    Is there no generic "area" that is capable of displaying any kind of content? Thanks

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: How can I display file (different formats) within my GUI?

    No.
    If it's an image then you'll need to load it as an image.
    If text then as a String (or similar).
    If some document format then you;ll need some software that understands that format.
    etc etc.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 0
    Last Post: 09-08-2011, 09:51 AM
  2. Replies: 0
    Last Post: 06-28-2011, 12:04 PM
  3. Replies: 1
    Last Post: 12-01-2010, 06:35 PM
  4. Replies: 0
    Last Post: 07-01-2010, 03:56 PM
  5. Class to play variety of video formats
    By Swankee in forum New To Java
    Replies: 0
    Last Post: 10-12-2009, 08:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •