Wednesday, August 27, 2008

How to remove or disable the Minimize, Maximize and Close Button of JFrame?

Yesterday a friend question me how can i remove or disable the minimize, maximize and close buttons of frame? Here shows some possibilities that could be a solution.

  • The first alternative is use a JWindow instead of a JFrame which does not have those three buttons.
  • The second alternative could be use JInternalFrame instead of a JFrame.
  • The third alternative is use the setUndecorated() method to disable the decorations to this frame and later decorate with a dialog style. The only problem is that the close button don't remove so you must disable its function such as can see below



  • The last alternative could be disable the close and resizable buttons such as can see bellow.


I believe there are more solutions, but for me are the most easy and utils...

Thursday, August 21, 2008

JODA - TIME a good option

Did you have headaches with Date and Calendar Java Classes? Effectively is one problem but thanks to the Joda-Time Project is most flexible manages its.

JODA - TIME is a project inside the JODA project which has such objective improve core Java functionality. Moreover represents the project most active.

Here has some of the characteristics most important:

  • Easy to Use
  • Easy to Extend
  • Calendar Support
  • Compressive Feature Set
Below you can see some examples of use:
  • About the constructor: With the DateTime Object you can create a date object through 12 different forms



  • Retrieves date components is more precise, bellow shows such as retrieve all possibles combination of days to a date



  • You can make date operations most easily. For example if you want add days, months, years to specific date can use some similar method:



Don't forget use, is a good alternative.....

Etiquetas: ,

Friday, August 15, 2008

Welcome

Welcome all the people who is interested in knows a few more about the JAVA World.

God bless you us....
MARTOSFRE