Category: J2SE

Java 2 Standard Edition

Java Essential Tips: Static Import

Static Import Static import is a mechanism to include constants into your code without referring its class in which the constants defined. For example, if you are using Integer.MAX_VALUE or some other constants field of class java.lang.Integer then you could simply use the following static import statement: [java]import static java.lang.Integer.*; class Demo{ public static void …

Continue reading

Permanent link to this article: https://blog.openshell.in/2012/01/java-essential-tips-static-import/

Scaling Image Using Java

This blog explains how to scale up or down an image using Java Advanced Image (JAI) API.

Permanent link to this article: https://blog.openshell.in/2011/07/scaling-image-using-java/

Java Essential Tips: Display JFrame in Center of the Screen

Target Audience: Java Beginners, Java Swing Developers What should you know already? Basics of Java Swing The beginners of Java might query “How do I display JFrame in center of screen?” on Google quite frequently. JFrame is the top level container in Swing API to show your GUI application. Commonly, there are 2 methods available …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/05/java-essential-tip-display-jframe-in-center-of-the-screen/

Java Essestial Tips: ArrayIndexOutOfBoundsException when Delete Elements From JList

Target Audience: Java Beginners, Java UI Developers, Swing Developers What should you know already? Java Swing API When you work around Java Swing UI components, especially JList, JTable or JComboBox, you should give your attention more than the attention you are giving for other components. Because these components are not just a single control, it …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/05/java-essestial-tips-arrayindexoutofboundsexception-when-delete-elements-from-jlist/

Excel to MySQL using Java

Target Audience: Java Developers, Database Developers What should you know already? Basics of Java, JDBC Excel to MySQL conversion can be done using LOAD DATA INFILE command as I discussed in Excel to MySQL blog. But that command is inadequate when you need to read the excel cell value and making some calculations or concatenations …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/05/excel-to-mysql-using-java/

JLayer component

The JLayer class is a flexible and powerful decorator for Swing components, which enables you to implement various advanced painting effects as well as receive notifications of all AWTEvents generated within its borders. It enables you to draw on components and respond to component events without modifying the underlying component directly. JLayer is a good solution if …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/04/jlayer-component/

Replace Special Characters Using Java

Using Java, have you ever been tried to replace all special characters in a String? Here is the fine example of replacing all special characters in a String using replaceAll() method. It also discusses about the difference between replace and replaceAll methods of java.lang.String class.

Permanent link to this article: https://blog.openshell.in/2011/03/replacing-special-characters-using-java/

Make use of toString() in Java

Every Java beginners must know about toString() method of java.lang.Object class. As you know java.lang.Object is the super most class in Java. Every pre-defined and user-defined class can override the methods available in the class java.lang.Object. Of these, toString() method plays a vital role. See the following example: int x = 100; System.out.println(x); This will …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/make-use-of-tostring-in-java/