Skip to main content

Posts

Showing posts with the label Swing

How to open a PDF file using ICEpdf Viewer from your Java Application?

Few weeks back I designed an application, where I wanted to display Help content through a PDF file rather than through a textbox in a JPanel, because the help content had complex formula stuffs. So I thought of embedding the PDF file with my swing application itself. But it was too tricky to learn in a short span of time. So I figured out two options to display the help content. By opening the PDF file using a native PDF Reader in the system, on click of the Help Button in my Java Swing application. By opening the PDF file using a PDF reader integrated with my application jar package, on click of the Help Button in my Java Swing application. I dont want to discourage the readers, but to be frank the above two methods didnt work for one bad reason. You need the absolute path of the PDF file to be used in the source code. One solution would be to load a PDF file from a Web link. Another solution would be to use an installation wizard (See here ) for your Java application to plac...

How to use JCalendar date picker in your Java Swing Applications with NetBeans

If you are one of those JAVA beginners like me who wants to implement a datepicker module in your experimental/business critical application developed with NetBeans IDE , then this for you. Let me share how I figured out to do so in simple steps with a sample code. Assuming that you have your Java Swing application ready, you will need to download the JCalendar package from here http://www.toedter.com/en/jcalendar/index.html . The page lists out various modules available with descriptions like JDateChooser, JCalendar, JYearChooser, JMonthChooser, JDayChooser, JSpinField and JLocaleChooser. The one I chose for my app was JDateChooser. After downloading and opening the ZIP file, you can see a whole set of files in it. The one we need is in the folder ‘lib’ with the name jcalendar-1.4.jar (this is the latest version while I was writing this). extract that file to your folder of comfort. The jar file you just extracted contains everything you need to implement the date picker in y...