Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6792521

Custom handling of shell components with full Swing support

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 6u10
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_vista

      Description

      A DESCRIPTION OF THE REQUEST :
      When developing GUI applications using Swing I find that the look and feel support incredibly helps my application stand out while still retaining a "windows-like" look and feel inside the shell.

      One problem I have recently came across in one of my applications is a lack of support for manipulating the shell to suit my applications needs. I am not talking about changing the general shape of it but rather being able to have full control over the decorations used. A good example that came across is having the ability to have something that looks like the Windows vista calendar window. As you can notice it does not have resizing ability, nor does it have the title bar caption.

      I heard people saying that such a "low-level" feature breaks support for multi-platform development however i feel that such a feature can be cleverly implemented to only be active on platforms that support it while compensating for others by replacing incompatible components with equivalent ones.

      JUSTIFICATION :
      I feel this enhancement is necessary because many applications and operating systems (as well as java libraries) are starting to implement advanced shell control that is really useful to some applications (in my case an application that includes a "pop-up" calendar for selecting a date much like the vista calendar).

      I know this can probably be done with some combination of look and feel and undecorated option however I wish to retain the legacy windows vista shell.

      Also, another reason to have this inside the standard java development kit is that people (especially new users) don't have to go hunting around and use a bunch of libraries to help them out. Just nice to have everything in one place.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1) Having the ability to assign different components to a shell (for decoration only)
      Example: Having a special class (like JWindow with a constructor for a Shell style) that lets us choose from a list of constants -> like new JWindow (STYLE1 | STYLE2 | etc). Some styles could be:
      MIN - minimize icon, MAX - maximize icon, CLOSE - Close icon, ICON - an icon, TITLE - a title, CAPTION - that title bar WITHOUT border, Border - See vista calender for example. If leaving a null then the window is undecorated.

      2) Having the ability to add custom buttons with icons etc. (see above with appropriate extension)

      3) Having the ability to make the font bigger in the title bar (wherever it is supported)

      4) Increasing the size of the caption bar (and or boarder) and maybe having the ability to place components in that (like the windows vista image viewer).

      Of course options 2, 3 and 4 are probably going above and beyond what Java is there for (everyone will probably say go use c++), I mention those in the slightest chance that it may one day be possible in java however option 1 is the most important and what i am really looking for.
      ACTUAL -
      Only gives us the option of JFrame or JDialog (with undecorated option or JWindow).

      CUSTOMER SUBMITTED WORKAROUND :
      After investing many hours of researching on the internet I have found that the closest effect I was looking for if inside the SWT library.

      creating a shell with styles such as SWT.RESIZE gave me the effect i was looking for however it combined the ability to resize which the only way to make it not resize was to write a series of complicated action handlers to restore the frame to its original size and position since no "setMaximumSize" option is available. Furthermore, combining this method with AWT and swing is really difficult so it would be nice to have something with native support with the swing library.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: