Best practice or good pattern for developing complex swing UI

When I develop some a bit complex swing UI which maybe contain many labels, fields etc. my code becomes massive. Especially when I use GridbagLayout, when there are many components on a panel, if I want to add or remove or change one component's position sometimes I need to modify many x, y to adjust. Are there any good pattern or solution for dealing with this? Should I write my own layout? Or to find a UI designer Plugin in eclipse (but I feel the codes generated by designer are usually hard to maintain)? Thanks.

I've recently been working with GridBagLayout. My current solution for working with this layout is to, whenever possible, create a panel builder class that builds the panel. This only works well, however, if your panel layout can be described in a generic fashion.
For example, I have a particular layout I want to use that consists of headers that can span the entire width of a panel with sections between the headers that consist of two roughly centered columns such that each section has the same center line between the columns. I can accomplish this with GridBagLayout. So I wrote a panel builder with methods addHeader(Component) and addRow(leftComponent, rightComponent), a few other helper methods, and behind the scenes, it prepares it all using a GridBagLayout.
Sort of like this:
MyPanelBuilder builder = new MyPanelBuilder();
builder.addHeading("Section 1");
builder.addRow(fooPanel, barPanel);
builder.addHeading("Section 2");
builder.addRow(aPanel, bPanel);
builder.addRow(cPanel, dPanel);
JPanel myPanel = builder.build();Behind the scenes, the panel builder keeps a list of everything it needs to add to the panel. Then when build is called, it lays it all out in a panel using GridBagLayout and returns it.
As for extending JFrame for your main application frame and JPanel for specific purpose application panels, I'm still not convinced it's a bad idea.

Similar Messages

  • Best practices to reduce downtime for Database releases(rolling changes)

    Hi,
    What are best practices to reduce downtime for database releases on 10.2.0.3? What DB changes can be rolling and what can't?
    Thanks in advance.
    Regards,
    RJiv.

    I would be very dubious about any sort of universal "best practices" here. Realistically, your practices need to be tailored to the application and the environment.
    You can invest a lot of time, energy, and resources into minimizing downtime if that is the only goal. But you'll generally pay for that goal in terms of developer and admin time and effort, environmental complexity, etc. And you generally need to architect your application with rolling upgrades in mind, which necessitates potentially large amounts of redesign to existing applications. It may be perfectly acceptable to go full-bore into minimizing downtime if you are running Amazon.com and any downtime is unacceptable. Most organizations, however, need to balance downtime against other needs.
    For example, you could radically minimize downtime by having a second active database, configuring Streams to replicate changes between the two master databases, and configure the middle tier environment so that you can point different middle tier servers against one or the other database. When you want to upgrade, you point all the middle tier servers against database A other than 1 that lives on a special URL. You upgrade database B (making sure to deal with the Streams replication environment properly depending on requirements) and do the smoke test against the special URL. When you determine that everything works, you configure all the app servers to point at B and have Streams replication process configured to replicate changes from the old data model to the new data model), upgrade B, repeat the smoke test, and then return the middle tier environment to the normal state of balancing between databases.
    This lets you upgrade with 0 downtime. But you've got to license another primary database. And configure Streams. And write the replication code to propagate the changes on B during the time you're smoke testing A. And you need the middle tier infrastructure in place. And you're obviously going to be involving more admins than you would for a simpler deploy where you take things down, reboot, and bring things up. The test plan becomes more complicated as well since you need to practice this sort of thing in lower environments.
    Justin

  • Best practice when modifying SAP Standard Development Component

    Hello Experts,
    What is best practice when modifying SAP Standard Development Component (Java Web Dynpro)? Iu2019m looking for the best method to do modifications to SAP Standard DC so that my changes will be kept (or need low maintenance) after a new service package (or EHP) is applied.
    Thanks,
    Kevin

    Hi,
      'How to use Busiess Packages in Enterprise Portal 6.0' is available in this link.
    http://help.sap.com/bp_epv260/EP_EN/documentation/How-to_Guides/misc/Using_Business_Packages.pdf
    Check out for the best practices.
    Regards,
    Harini S

  • Which is the best and user freindly IDE for developing  J2EE applications ?

    Please advice me if there is any good IDE for developing all kind of Java applications.
    I m confused about which IDE to use.
    I have Searched on Net also. and most of the answers i found was for JBuilder and JBoss.
    But cant confirm until u guys suggest me.
    Because i think this is the best place to ask questions about java.
    Please advice

    i would prefer Eclipse rather than JBuilder.

  • Which is the best and user freindly IDE for developing Java GUI application

    Please advice me if there is any good IDE for developing all kind of Java applications.
    I m confused about which IDE to use.
    I have Searched on Net also. and most of the answers i found was for JBuilder and JBoss.
    But cant confirm until u guys suggest me.
    Because i think this is the best place to ask questions about java.
    Please advice

    If you're developing JSPs and Servlets....
    I've found that using Eclipse (which is free) coupled with the MyEclipse plug-in (an advanced J2EE specific plug-in which costs $29.99USD/year) was the best for me. I've tried several free J2EE Eclipse plug-ins, didn't like them. Wasn't a big fan of NetBeans either, but I liked it tons better than the other Eclipse plug-ins.
    Therefore, IMHO for free I'd go with NetBeans, for a small fee I'd go with Eclipse/MyEclipse plug-in.
    If you are new to J2EE but not to Java, you may want to consider going straight to JSF and Sun's Java Studio Creator. This is not free, but the fee is one-time and development is (mostly) visual using Java Studio Creator.

  • Best practice to define length for varchar field of table in sql server

    What is best practice to define length for a varchar field in table
    where field suppose Remarks By Person  varchar(max) or varchar(4000)
    Could it affect on optimization in future????
    experts Reply Must ... 
    Dilip Patil..

    Hi Dilip,
    Varchar(n/max) is a variable-length, non-unicode character data. N defines the string length and can be a value from 1 through 8,000. Max indicates that the maximum storage size is 2^31-1 bytes (2 GB). The storage size is the actual length of the data entered
    + 2 bytes. We always use varchar when the sizes of the column data entries vary considerably. While if the filed data size might exceed 8,000 bytes in some way, we should use varchar(max).
    So the conclusion is just like Uri said, use varchar(max) or varchar(4000) is depends on how much characters we are going to store.
    The following document about varchar in SQL Server is for your reference:
    http://technet.microsoft.com/en-us/library/ms176089.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Best practice on Oracle VM for Sparc System

    Dear All,
    I want to test Oracle VM for Sparc System but I don't have new model Server to test it. What is the best practice of Oracle VM for Sparc System?
    I have a Dell laptop which has spec as below:
    -Intel® CoreTM i7-2640M
    (2.8GHz, 4MB cache)
    - Ram: 8GB DDR3
    - HDD: 750GB
    -1GB AMD Radeon
    I want to install Oracle VM VirtualBox on my laptop and then install Oracle VM for Sparc System in Virtual Box, is it possible?
    Please kindly give advice,
    Thanks and regards,
    Heng

    Heng Horn wrote:
    How about computer desktop or computer workstation with the latest version has CPU supports Oracle VM or SPARC?Nope. The only place you find SPARC T4 processors is in Sun Servers (and some Fujitsu servers, I think).

  • Best Practice setting up NICs for Hyper V 2008 r2

    I am looking at some suggestions for best practice for setting up a hyper V 2008 r2 at a remote location with 5 nics, one for managment vlan and other 4 on the data vlan.  This server will host  2 virtual machines, one is a DC and the other
    is a member local DHCP server.  The server is setup now with one nic on the management Vlan and the other nic's set to get there ip from the local dhcp server on on the host.   We have the virtual networks setup in Hyper V to
    point to each of the nics using the "external connection".  The virtual servers 'DHCP and AD" have there own ip set within them.  Issues we are seeing,  when the site looses external connections for a while they cannot get ip
    addresses from the local dhcp server anymore.
    1. NIC on management Vlan -- IP Static -- Physical host
    2. NIC on the Data network Vlan -- DHCP linked as a connection "external" in Hyper V  -- virtual server DHCP
    3. NIC on the Data network Vlan -- DHCP linked as a connection "external" in Hyper V -- Virtual server domain controller
    4. NIC on the Data network Vlan -- DHCP linked as a connection "external" in Hyper V -- extra
    5. NIC on the Data network Vlan -- DHCP linked as a connection "external" in Hyper V -- extra
    Thanks in advance

    Looks like you may be over complicating things here.  More and more of the recommendations from Microsoft at this point would be to create a Logical Switch and then layer on Logical Networks for your management layers, but here is what I would do for
    you simple remote office.  
    Management NIC:  Looks good (Teaming would be better, but only if you had 2 different switching to protect against link failures at the switch level.  Doesn't seem relevant in this case however.
    NIC for Data Network VLAN:  I would use one NIC in your case if you can have the ability to Trunk multiple VLANs at the switch level to the NIC.  That way you are setting the VLAN on the VMs NIC that you want to access and your
    Virtual Switch configuration is very simple.  On this virtual switch however, I would uncheck IPv4 and IPv6.  There is no need to give this NIC an address as you are just passing traffic through them from the VMs that are marked with VLAN tags.  Again,
    if you have multiple physical switches in the building teaming could be an option, but probably adds more complexity than is necessary for a small office. 
    Even if you keep your Virtual Switches linked to separate NICs unchecking IPv4 and IPv6 makes sense. 
    Disable all the other NICs
    Beyond that, check your routing.  Can you ping between all hosts when there is not interruption? What DHCP server are they getting there addresses on normally?  Where are your name resolution servers (DNS, WINS)?  
    No silver bullet here, but maybe a step in the right direction.
    Rob McShinsky (VirtuallyAware.com)
    VirtuallyAware - Experiences in a Virtual World (Microsoft MVP - Virtual Machine)

  • Good References for developing in Landscape Mode?

    Just wondering if there's a portion of the Programming guide, or if there are any good sample apps or sites out there with tips and best practices for developing apps with landscape views?
    Googling and searching based on "horizontal or landscape view" doesn't seem to narrow it to quite what I"m looking for.
    Specifically, I have an tab bar app that is mostly portrait, but I want the user to be able to enter a view that is landscape. (whether by button push, or rotating when in a particular view)...I'm hoping for my landscape view to essentially be independent of the rest of the app (i.e. no tab bar, specific actions, graphics, etc...)
    Anyways, just looking for some good starting points for this if there are any recommendations....

    http://developer.apple.com/iphone/library/codinghowtos/UserExperience/#GENERAL-S TARTMY_APPLICATION_IN_LANDSCAPEMODE
    http://developer.apple.com/iphone/library/codinghowtos/UserExperience/#GENERAL-E NABLE_AUTOROTATION
    http://developer.apple.com/iphone/library/codinghowtos/UserExperience/#GENERAL-H ANDLEAUTOROTATION_OF_MY_USERINTERFACE
    From: http://developer.apple.com/iphone/library/codinghowtos/UserExperience/
    All and more @:
    iPhone Dev Center > iPhone OS Library > Topics >
    User Experience Coding How-To's
    And for good measure:
    iPhone Human Interface Guidelines
    http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptua l/MobileHIG/index.html
    Finally, for otherwise obscure info you may find only by stumbling around:
    http://iphonedevelopertips.com/cocoa/changing-views-to-landscape-mode.html

  • Best Practice of copying Production to Development

      Hi everyone.  My management would like some documentation  on the Best Practice of copying Production systems to Development. 
    1. In the past, we've setup the clients and connections/interfaces and shrink the database by deleting unneeded production data. Now that there is note 130906, saving the ABAP versions may be easier. 
    2. Every two or three years we copy our BIW Production to Development.  This is also labor intensive to set up the development system again with source systems.
    3. We've copied our PI 70 system to a sandbox, and again this is labor intensive to reset the PI object names, since the system names are imbedded in the object names.
    4. I've done java systems to, so I'm not to concerned about these.
    5. There is talk of copying the following Production systems to Development systems - SLD, PI 7.1, Solution Manager, SAP R/3, BIW, MII...some of these make sense, others we question if it is worth it.
      As a note, we copy our SAP R/3 Production instance to our QA environment about twice a year and to another QA system monthly.  We also copy our CRM Production to our QA environment twice a year and BIW Production to QA environment once a year.  We can leverage what we know about copying to PRD to QA, but we want to give them alternatives about copying PRD to DEV.
    We'd like to use SAP's TDMS to move data from PRD to DEV.  But unfortunately, that project has not gotten management  attention as being a high priority (yet).
    Rather than take my  word for it, is there any SAP provided documentation that would give my management a set of alternatives on their desire to copy our Production systems to Development.
    Thanks...Scott B.

    From a E2E200 perspective SAP recommends the following landscape:
    Maint = Dev -> QA -> Pre-Prod -> Prod
    N+1 =  Dev2 -> QA2 -> Pre-Prod -> Prod
    Maint is all object versions to remain ideally the same versions, and only transports to fix a short dumping Prod system.  N+1 is where you have implementation/upgrade projects worked on and allow you import the entire project of transports.
    Another consideration, when you restore a Prod system to a Dev or new Dev system; you are destroying all of your version info which means your developers can't view or revert changes for the objects.

  • Best practice MPLS design/configuration for small service provider

    We are a small regional service provider and did not have MPLS supported on our network.  To start supporting MPLS, I’d like to get opinions and recommendations on the best practice configuration. 
    Here is what we have today –
    We have our own BGP AS and multiple /24s.
    We are running OSPF on the Cores and BGP on the Edge routers peering with ISPs.
    We peer with multiple tier-1 ISPs for internet traffic. We do not provide public transit.
    What we want for phase one MPLS implementation –
    Configure basic MPLS /vpn functionality.
    No QoS optimization required for phase 1.
    We have Cisco ME 3600X for  PE. Any recommendations will be appreciated.

    Not sure what kind of devices or routers you have in your network but looks for if you have support for labeled multicast for MVPN support. That will avoid other complexity of using other control protocols (like PIM) in core.
    PE redundancy can be obtained by BGP attributes, CE-PE connectivity can be tunned using IGP or VRRP/HSRP...
    You can have mutiple RSVP TEs for various contract traffic and you can bind various kind of traffic to different RSVP Tunnels based on contract or service with your customer.
    RSVP-TE with link/node protection design will be of great help to achieve quicker failover.

  • Best Practices or Project Template for Rep/Version

    I have installed the Repository 6i (3) and created the users successfully, even though it has taken a lot of effort to make sure each step is correct.
    However, on setting up the workareas and importing the project files, I have been trying back and force to figure out where things go, and who has what access.
    Is there something like a best practice or a project template for setting up a basic repository/version control system, that provides
    1. the repository structure,
    2. corresponding file system structure (for different developers, build manager, etc)
    3. access grants, and
    4. work scenarios, etc.
    The Technet demos and white papaers are either too high-level (basic), or too individual function oriented. I can't get a clear picture of the whole thing, since there are so many concepts and elements that don't easily go together.
    Considering that I am a decent DBA and developer, it has taken me 2 weeks, and I am still not ready to sign up other developers to use this thing. How do you expect any small development teams to ever use it? It's one thing to design it to be scalable and all-possible, it's another to make it easily usable. I have been suggested to use MS VSS. The only reason I am still trying Ora-Rep is its promise to directly support Designer and Oracle objects.

    Andy,
    I have worked extensively with the Repository over the last year and a half. I have collected some of my experiences and the derived guidelines on using the Repository in real life in a number of papers that I will be presenting at ODTUG 2001, next week in San Diego. If you happen to be there (see www.odtug.com), come and see me and we could talk through your specific situation. If you are not and you are interested in those papers, drop me an Email and I could send them to you (they probably will also become available on OTN right after the ODTUG conference).
    best regards,
    Lucas

  • Best Practice : Creating Custom Renderer for Standard Component

    I've been reading the docs and a few threads about Custom Renderers. The best practice seems to be to create a Custom Component where you need a Custom Renderer. Is this the case?
    See [this post|http://forums.sun.com/thread.jspa?forumID=427&threadID=520422]
    I've created several Custom Renderers to override the HTML provided by the Standard Components, however I can't see the benefit in also creating a Custom Component when the behaviour of the standard component is just fine.
    Thanks,
    Damian.

    It all depends on what you are trying to accomplish. Generally speaking if all you need is for the user interface output to be changed then a renderer will work just fine. A new component is usually made in order to provide some fundamental change in server side functionality not related to the user interface. - Ponderator

  • Best Practice Advice - Using ARD for Inventorying System Resources Info

    Hello All,
    I hope this is the place I can post a question like this. If not please direct me if there is another location for a topic of this nature.
    We are in the process of utilizing ARD reporting for all the Macs in our district (3500 +/- a few here and there). I am looking for advice and would like some best practices ideas for a project like this. ANY and ALL advice is welcome. Scheduling reports, utilizing a task server as opposed to the Admin workstation, etc. I figured I could always learn from those with experience rather than trying to reinvent the wheel. Thanks for your time.

    hey, i am also intrested in any tips. we are gearing up to use ARD for all of our macs current and future.
    i am having a hard time with entering the user/pass for each machine, is there and eaiser way to do so? we dont have nearly as many macs running as you do but its still a pain to do each one over and over. any hints? or am i doing it wrong?
    thanks
    -wilt

  • BPC 5 - Best practices - Sample data file for Legal Consolidation

    Hi,
    we are following the steps indicated in the SAP BPC Business Practice: http://help.sap.com/bp_bpcv151/html/bpc.htm
    A Legal Consolidation prerequisit is to have the sample data file that we do not have: "Consolidation Finance Data.xls"
    Does anybody have this file or know where to find it?
    Thanks for your time!
    Regards,
    Santiago

    Hi,
    From [https://websmp230.sap-ag.de/sap/bc/bsp/spn/download_basket/download.htm?objid=012002523100012218702007E&action=DL_DIRECT] this address you can obtain .zip file for Best Practice including all scenarios and csv files under misc directory used in these scenarios.
    Consolidation Finance Data.txt is in there also..
    Regards,
    ergin ozturk

Maybe you are looking for

  • Specific character in a sequential file

    i have this file H;001;t;2;3;1;y;y;n;flgjdfl;2000 H;002;t;2;3;1;y;y;n;flgjdfl;2000 H;003;f;2;3;1;y;y;n;flgjdfl;2000 i want to check whether the third field is t/f.how do i check it?

  • Help to make iPhoto mirror Aperture

    I have not used iPhoto recently but after updating Aperture to 3.3 I now would like to use iPhoto again but would like it to mirror Aperture with the same albums, smart albums, etc. Now when I open iPhoto the library is there but no albums. Can iPhot

  • Apache attack

    I've posted this in the MacEnterprise forum. Here it is... I have a fully configured server at home (domain name, mail, OD, etc) in order to try and evaluate situations. I do not have a firewall. Last week, I noticed that the server's NIC was working

  • Why can't I get iCal from my MBP to sync to the calendar on iPhone 3GS?

    I can see all the different activities I have on iCal on my MBP but I can't see them on my iPhone 3GS?  I use iCloud and the setting for calendar is turned on.  I also refreshed my iCal and then refreshed the calendars on my iPhone.  Any help is appr

  • Manually comparing Page items from two versions of an application?

    Hi folks, I have two separate applications, one being an older version of the other. Is there a way to query the APEX metadata on a per page item basis to check for any small changes between items, or which items exist on one but not the other?