Is XML the best option?

Hi all
I am developing an application in Java whereby I have several JComponents on a JPanel that the user has defined (coordinates wise) using drag and drop. I would like to implement the ability to save the "workspace" (the contents of the JPanel and their positions), and also to open these saved files.
I have been thinking of using XML to implement this save functionality but is this the best way? I know that I could create a I/O text file and write the objects and their coordinates in there but this is pretty inelegant approach.
Any suggestions will be much appreciated.

<panel>
<panelName>XYZ</panelName>
<panelCoordinates>
</panelCoordinates>
</panel>
You could certainly create an XML-based language for saving information of the "workspace", or data about the JComponents on a JPanel.
This can be one way to save the data.
You could also save the data in a relational database. You could also save the data in a basic comma-delimited text file. You could also serialize the JPanel objects
Is using XML the best way?
Using an XML-based language is great for storing data in a human friendly format to make it easy for humans to read. Are any humans going to be reading these XML files with JPanel coordinates?
XML-based data is useful for situations when you have to send complex data to other applications and/or third-parties. Will your XML data be sent to any other applications or locations?
If no to these questions, I would choose to save the data in a basic comma-delimited format in a simple text file.
If other applications need to read this file, they can do so just an easy as if it were in XML format.

Similar Messages

  • Looking to upgrade my OS from 10.5.8 to something newer, what would be the best option?

    I would like to upgrade my operating system, but not sure what would be the best option. I have had the computer for several years and haven't had a problem, I just think it's time to upgrade. Any suggestions?

    Which model iMac do you have?
    The best option would be the one (OS) that meets your needs of what you want to do AND if you meet ALL the OS system requirements.  Suggest that you read the system requirements of the OS you are interested in to make sure you meet all the requirements both hardware & software.

  • I have Logic Pro 8.0.2 and would like to upgrade. I'm running OS Lion on a 2010 MacB Pro. What is the best option? Logic Pro 9 App or Logic Studio? Can't find upgrade price. Or should I just stay with Logic 8?

    I have Logic Pro 8.0.2 and would like to upgrade. I'm running OS Lion on a 2010 MacB Pro. What is the best option? Logic Pro 9 App or Logic Studio? Can't find upgrade price. Or should I just stay with Logic 8?

    Same here, I have Logic Studio 8 and wouldn't mind staying with that version, except that the installer won't run on my new Macbook Pro as PowerPC apps are no longer supported. That's the message I get in any case.
    I use to run Logic on a 2006 Macbook Pro.
    I guess that makes me a very unhappy Apple user! I've been using Logic from the Emagic days, bought every upgrade only to see Apple kill what used to be one of the best Pro Audio application. Imagine if they had done the same to Photoshop, there would be a lot of unhappy designers out there
    Paying the full price for years to slowly see your daily app go down in price & efficiency until it's given away at $199 for semi pro users. Well, at least ProTools is stil alive & kicking so I guess that's the way forward now.
    This is coming from someone that never ever used a Windows machine to make music! Life is good still!

  • The best option to create  a shared storage for Oracle 11gR2 RAC in OEL 5?

    Hello,
    Could you please tell me the best option to create a shared storage for Oracle 11gR2 RAC in Oracel Enterprise Linux 5? in production environment? And could you help to create shared storage? Because there is no additional step in Oracle installation guide. There are steps for only asm disk creation.
    Thank you.

    Here are names of partitions and permissions. Partitions which have 146 GB, 438 GB, 438 GB of capacity are my storage. Two of three disks which are 438 GB were configured as RAID 5 and remaining disk was configured as RAID 0. My storage is Dell MD 3000i and connected to nodes through ethernet.
    Node 1
    [root@rac1 home]# ll /dev/sd*
    brw-r----- 1 root disk 8, 0 Aug 8 17:39 /dev/sda
    brw-r----- 1 root disk 8, 1 Aug 8 17:40 /dev/sda1
    brw-r----- 1 root disk 8, 16 Aug 8 17:39 /dev/sdb
    brw-r----- 1 root disk 8, 17 Aug 8 17:39 /dev/sdb1
    brw-r----- 1 root disk 8, 32 Aug 8 17:40 /dev/sdc
    brw-r----- 1 root disk 8, 48 Aug 8 17:41 /dev/sdd
    brw-r----- 1 root disk 8, 64 Aug 8 18:26 /dev/sde
    brw-r----- 1 root disk 8, 65 Aug 8 18:43 /dev/sde1
    brw-r----- 1 root disk 8, 80 Aug 8 18:34 /dev/sdf
    brw-r----- 1 root disk 8, 81 Aug 8 18:43 /dev/sdf1
    brw-r----- 1 root disk 8, 96 Aug 8 18:34 /dev/sdg
    brw-r----- 1 root disk 8, 97 Aug 8 18:43 /dev/sdg1
    [root@rac1 home]# fdisk -l
    Disk /dev/sda: 72.7 GB, 72746008576 bytes
    255 heads, 63 sectors/track, 8844 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 8844 71039398+ 83 Linux
    Disk /dev/sdb: 72.7 GB, 72746008576 bytes
    255 heads, 63 sectors/track, 8844 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 4079 32764536 82 Linux swap / Solaris
    Disk /dev/sdd: 20 MB, 20971520 bytes
    1 heads, 40 sectors/track, 1024 cylinders
    Units = cylinders of 40 * 512 = 20480 bytes
    Device Boot Start End Blocks Id System
    Disk /dev/sde: 146.2 GB, 146278449152 bytes
    255 heads, 63 sectors/track, 17784 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sde1 1 17784 142849948+ 83 Linux
    Disk /dev/sdf: 438.8 GB, 438835347456 bytes
    255 heads, 63 sectors/track, 53352 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdf1 1 53352 428549908+ 83 Linux
    Disk /dev/sdg: 438.8 GB, 438835347456 bytes
    255 heads, 63 sectors/track, 53352 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdg1 1 53352 428549908+ 83 Linux
    Node 2
    [root@rac2 ~]# ll /dev/sd*
    brw-r----- 1 root disk 8, 0 Aug 8 17:50 /dev/sda
    brw-r----- 1 root disk 8, 1 Aug 8 17:51 /dev/sda1
    brw-r----- 1 root disk 8, 2 Aug 8 17:50 /dev/sda2
    brw-r----- 1 root disk 8, 16 Aug 8 17:51 /dev/sdb
    brw-r----- 1 root disk 8, 32 Aug 8 17:52 /dev/sdc
    brw-r----- 1 root disk 8, 33 Aug 8 18:54 /dev/sdc1
    brw-r----- 1 root disk 8, 48 Aug 8 17:52 /dev/sdd
    brw-r----- 1 root disk 8, 64 Aug 8 17:52 /dev/sde
    brw-r----- 1 root disk 8, 65 Aug 8 18:54 /dev/sde1
    brw-r----- 1 root disk 8, 80 Aug 8 17:52 /dev/sdf
    brw-r----- 1 root disk 8, 81 Aug 8 18:54 /dev/sdf1
    [root@rac2 ~]# fdisk -l
    Disk /dev/sda: 145.4 GB, 145492017152 bytes
    255 heads, 63 sectors/track, 17688 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 8796 70653838+ 83 Linux
    /dev/sda2 8797 12875 32764567+ 82 Linux swap / Solaris
    Disk /dev/sdc: 146.2 GB, 146278449152 bytes
    255 heads, 63 sectors/track, 17784 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdc1 1 17784 142849948+ 83 Linux
    Disk /dev/sdd: 20 MB, 20971520 bytes
    1 heads, 40 sectors/track, 1024 cylinders
    Units = cylinders of 40 * 512 = 20480 bytes
    Device Boot Start End Blocks Id System
    Disk /dev/sde: 438.8 GB, 438835347456 bytes
    255 heads, 63 sectors/track, 53352 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sde1 1 53352 428549908+ 83 Linux
    Disk /dev/sdf: 438.8 GB, 438835347456 bytes
    255 heads, 63 sectors/track, 53352 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdf1 1 53352 428549908+ 83 Linux
    [root@rac2 ~]#
    Thank you.
    Edited by: user12144220 on Aug 10, 2011 1:10 AM
    Edited by: user12144220 on Aug 10, 2011 1:11 AM
    Edited by: user12144220 on Aug 10, 2011 1:13 AM

  • What is the best option for tethering my IPhone 4s with my iPad? (the iPad is wifi only)

    What is the best option for tethering my IPhone 4s with my iPad? (the iPad is wifi only)

    #1. Understand that if you switch carriers, you can NOT take your existing iPhone with you. It won't work. You will need to purchase a new one.
    #2. Your only choices are Sprint and Verizon. Decide who has the better coverage in your area. Keep in mind that you will NOT be able to get simultaneous voice and 3G data on either of these, as their CDMA networks do not support it. The U.S. T-Mobile network is not supported and is not fully compatible with the iPhone as it operates on a rarely used frequency compared to the rest of the world.
    #3. What in the world are "niners"? Do you mean you want to be able to keep your existing "phone numbers"? If so, that should be no problem. Most numbers in the US are now portable.
    #4. Consider WHY you want to switch. If the issue is really price, you're not going to see much of a difference. A few dollars a month at best for comparable voice and data plans.

  • What is the best option for 'update.... set' in owb?

    Hello.
    I have been reading on a number of ways to implement following query in OWB:
    update TABLE A
    set Value F = (select Value B
    from table B
    where (nvl(trim(A.valueC),trim(A.valueD) = trim(B.ValueF)
    and substr(A.valueG,1,2) = trim(B.valueH))
    or ( nvl(trim(A.valueC),trim(A.valueD)) is null
    and trim(B.valueF) is null
    and substr(A.valueG,1,2) = trim(B.ValueH)
    The table A and table B do not have a relationship.
    Key lookup - some of you recommend not to use it as it is not very good.
    Set Operator or Joiner? What would be better?
    I created a function for this query, but i cannot use it in the map because i get this error:
    API8003:coonection target attribute group is already conncted to an incompatable data source. Use a Joiner or Set operator to join the upstream data first before conncting it into this operator.
    What would be the best way to do it? how i can pass the parameters from two different tables into my function? What feature of OWB would be the best option i cannot use for this?
    Or my best bit to re-create it as a procedure and run it that way?
    Thank you very much for your help
    Kind Regards
    Vix

    Hopefully this is helpful and it makes sense written out.
    First, I'm not sure if there are some parenthesis missing in your update statement because I can't tell for sure whether the statements separated by the 'or' should be considered separately [ as in "(a = b and a=c) or (c = d)" vs "a = b and a = c or c = d" ] or if the logic is exactly as written. My suggestion is based on the idea that the query is exactly as written -- if parenthesis were missing, insert them as appropriate.
    My suggestion is to use a join. Even though you say A and B don't have a relationship, they sort of do based on the update statement.
    I would suggest that you start with source A and insert an expression operator. You'll send in ValueC, ValueD, ValueG. You create three outputs:
    BValueF = nvl(trim(A.valueC),trim(A.valueD))
    BValueH = substr(A.valueG,1,2)
    NullValue = nvl(trim(A.valueC),trim(A.valueD))
    Then add source table B and insert another expression operator. You'll send in ValueF and ValueH. You create two outputs:
    TValueF = trim(B.valueF)
    TValueH = trim(B.valueH)
    Then insert a join operator. For ingrp1, you'll drag over whatever can uniquely identify A and the three outputs from the expression. For ingrp2, drag over ValueB and the two outputs from the expression.
    Then your join condition will be
    BValueF = TValueF
    and BValueH = TValueH
    or NullValue is null
    and TValueF is null
    and BValueH = TValueH
    Then add your target table A, set it to update on the unique key. Drag the unique key from the joiner to the unique key on A, and drag ValueB to A's ValueF.
    Hopefully this makes sense written out. I didn't test this, but it looks logically correct on paper.
    Good luck,
    Heather

  • Whats the best option for passing parameters between tf?

    Dear All,
    I have three Task Flows:
    1. TF1
         -  Main Taskflow that calls a web service to gather its data
    2. TF2
         -  Secondary taskflow which receives a parameter and depending on the value of the parameter received will display its data accordingly.  Generally any data
         is feed from TF1
    3. TF3
         -  Same as TF2Use Case:
    All three TF will be dropped to the page as Regions in a Webcenter Portal Application. Changes in TF1 should propagate into TaskFlow 2.
    Question:
    1. How do I configure that changes in TF1 would be propagated back into task flow 2 and 3 and whats the best option for this?
    2. At runtime, user can choose to edit the page and TF2 and TF3 can be deleted but TF 1 should remain as the source of information.
    Given the scenario above:
    - shall I wire the taskflows via page parameters?
    - contextual events?
    What are the considerations that needs to be thought of. I havent done such requirements before.
    Please help.
    Webcenter 11.1.1.6

    Contextual events seem to be the best case.
    This way you can trigger whenever you want. Web services can be slow so you can trigger the event when the gathering of the data has been finished and then pass some value on the event.
    An event also has a payload so it's an ideal scenario to add the data from the service on it so you can use it in the other TF's.
    In order to manage the deletion of the TF1, you can use the UI events on the composer: http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10148/jpsdg_page_editor_adv.htm#CHDHHFDJ

  • What is the best option to get a wireless connection please?

    Hi, I have a 1.6 GHz G5 with Tiger (soon to install Leopard).
    I currently have broadband through an ethernet cable but I want to set up wireless. My understanding so far is that I need either an airport card or an external device such as airport express (in the system profiler it says no info found under AirPort card).
    Can someone please tell me if I am correct and if so, what is the best option to buy for my G5 model?
    Thanks very much
    Adam

    BD, I declare an interest!
    Look here if you would:  https://discussions.apple.com/thread/4229088?tstart=60
    I like the look of the one in your third link, but the only similar one I can find in the UK is this:
    http://www.amazon.co.uk/Daffodil-LAN02-Wireless-Internet-Adapter/dp/B003FBVUH8/r ef=wl_it_dp_o_pC_nS_nC?ie=UTF8&colid=2QR3S4NSXNBE1&coliid=I2JD2YDHCMB4HH
    but it comes with a 3 inch CD which is utterly useless to me!
    If you can confirm that the MXP2802GU2 will work for me I will buy that!
    TIA

  • What is the best option

    Hi,
    I am looking for a wireless hard drive to use with Windows Vista that;
    1. I can access wirelessly when at home, and
    2. I can also access over the tinternet when away from home.
    Is the Time Capsule the only option and the best option?
    Thanks

    I have a MacBook and yes it is incredibly faster than my old powerbook. However I am thinking of upgrading to a MacBook Pro primarily for the higher internal RAM capability, as well as the faster processor.
    What I find is that when I am running windows in a parallels environment and also running Mac concurrently, I have a problem with system freezes. If you have a lot of memory hog programs going on at the same time in both Mac and Windows, it is difficult to allocate the RAM satisfactorily. If you allocate it to maximize your Mac OS performance you can wind up with virtual memory issues and windows programs freezing on you and becoming non responsive. If you allocate to maximize your Windows use it slows down your Mac performance.
    If you plan to run programs concurrently that take up a lot of RAM, for the little bit of extra money you may be much happier going with a MBP with 4 GB RAM. The limit on the MB is 2 GB. I wish I had bought a MBPro so that I would not be in a situation of outgrowing and upgrading my computer this soon.

  • What is the best option today for an external DVD Drive self powered

    I am planning to remove the internal DVD-ROM and use the MCE OptiBay to install a second SSD in RAID 0 configuration, what is the best option today for an external DV-ROM, ideally self powered via USB or Firewire ?, thanks

    can't say I agree with the RAID 0, if that messes up or one drive dies, you lose it all. Not to mention, The SSDs made like that aren't made for RAIDs...
    The ones that can are really expensive, high end stuff.
    http://addonics.com/products/externalcd/pocketusib.asp
    http://addonics.com/products/externalcd/pocketii.asp

  • What is the best option for storing my iphoto library on the cloud?

    I was curious as to what people are doing (other than backing up to external HD) for backing up the iphoto library?  Anyone using any cloud solution out there for storage?  What are some of the best options?  I have around 30,000 photos in my iphoto library.

    There is no good solution for storing the Library in the Cloud. The amount of data involved means that uploading or downloading is very, very slow. We do see posts on here from people trying to restore from a back up to the Cloud wondering if it's possible to speed up the download currently estimated in days. Running a Library from the cloud is just painfully slow - people have tried it and that is the consensus.
    However, as part of a comprehensive back up plan there is a lot to be said for backing up your Photos to the cloud. Not as good as backing up the whole Library, but as a "last line" you at least have your photos. There are many options: Flickr, Picasa, SmugMug etc. However, check the terms of your account carefully. While most sites have free uploading, you will often find that these uploads are limited in terms of the file size or the bandwidth you can use per month. For access that allows you to upload full size pics with no restrictions you may need to pay.

  • What is the best option to connect my ipad to play on my BWM1 ?

    Hello,
    I just bought the BW MM1
    http://www.bowers-wilkins.com/iPod_and_Computer_Speakers/iPod_and_Computer_Speak ers/MM-1/Overview.html
    I am wondering if connection my Ipad to the MM1 with the jack is the best option to get a pure sound ?
    Or maybe can i use the airplay with the help of my time capsule ?
    Is there any other alternative for the best possible sound ?
    Many thanks

    These are digital speakers, designed to connect directly to a computer by the USB port. You can use them with an iPad, with an analogue cable, but you paid a lot of money and you will not get the quality that you paid for when using it with an iPad.

  • FlexReport - is it still the best option?

    Is FlexReport still a viable option for preview/printing with Flex 3.  Also if anyone has any experience with it or alivePDF - Is there anyway to keep the datagrid dataprovider column order?  In my test they always seem to sort by alpha headers, I have not been able to locate the code that performs this function.  Thanks for all advice.

    What is best depends in part on your particular needs. Due to loss of significant features in recent versions of Pages and Numbers in iWork and for other reasons, I switched. The following is very capable and very compatible and free: http://www.libreoffice.org
    For many, Microsoft Office of Mac is the best option: http://www.microsoft.com/mac

  • Is Maven the best option?

    Just wrote a small java program to help me organize some music. I developed it on my laptop and now would like to run some tests on the server it will be used on. There are 1 external package (JAudioTagger) and 1 external jar (log4j) being used by my program. Also, there is a log directory for the log file that gets produced from this program. I would like to package all these files together so I can run it on my server. Is Maven the best option to do this?

    ejp wrote:
    Like EJP said, it's relative.Not only did I not say that, I don't actually believe that absolutes are relative, having taken a Philosophy major, some years ago. Here I presume that the OP means 'better' not 'best', in which case I would want to know what the OP is comparing Maven to. Fair comment. I misquoted you, sorry about that.
    Maven is very nice if you completely accept the way it does thingsNot so fair comment. Well, true on the face of it, but "the way it does things" is rather more broad and flexible than it may first appear. Trouble starts when people think of it in terms of, say, Ant. Its approach is fundamentally different.
    which I reserve the right to reserve judgment on ;-)Well, yes. Always the case!

  • If I have  awindows based software that I am trying to run on my macbook, is parallels the best option

    I have one software product that runs on Windows but do not have windows on my mac. Is parallels the best option to be able to use my windows based software

    It would be a good choice. Other choices are:
    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
         1. Install the Apple Boot Camp software.  Purchase Windows
             XP w/Service Pak2, Vista, or Windows 7.  For Boot Camp
             4.0 and above you can only use Windows 7 or later. Follow
             instructions in the Boot Camp documentation on
             installation of Boot Camp, creating Driver CD, and
             installing Windows.  Boot Camp enables you to boot the
             computer into OS X or Windows.
         2. Parallels Desktop for Mac and Windows XP, Vista Business,
             Vista Ultimate, or Windows 7.  Parallels is software
             virtualization that enables running Windows concurrently
             with OS X.
         3. VM Fusion and Windows XP, Vista Business, Vista Ultimate,
             or Windows 7.  VM Fusion is software virtualization that
             enables running Windows concurrently with OS X.
         4. CrossOver which enables running many Windows
             applications without having to install Windows.  The
             Windows applications can run concurrently with OS X.
         5. VirtualBox is an Open Source freeware virtual machine such
             as VM Fusion and Parallels that was developed by Solaris.
             It is not as fully developed for the Mac as Parallels and VM
             Fusion.
    Note that VirtualBox, Parallels, and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech Labs- Virtualization Benchmarks, January 2013 | MacTech for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

Maybe you are looking for