Search
Search Keyword java tips
Total 99 results found. Search for [ java tips ] with Google

Results 1 - 50 of 99
1. Latest Additions - 15.11.06 (16 new tips)
(Newsflashes/NewsFlashes)
Java EE Tips / Web Services Why Web Services are needed in Industry What is UDDI Protocol What is Simple Object Access Protocol What is a Web Service What are Different Web S

Following piece of code creates a bean with static method makeInstance of sampleBean2 class. <bean id="sampleBean" class="sample.SampleBean2" factory-method="makeInstance"/>

3. How to make beans aliases
(Java EE Tips/Spring Framework)
Aliases are used in many situations for example if a component defines a resource by some name and another component want to use that resource by different name suiting to naming of that component al

Container definition can be spit to the multiple XML files and combined through Import keyword. <beans> <import resource="services.xml"/> <import resource="message.xml"/

The org.springframework.beans and org.springframework.context packages provide the basis for the Spring Framework's IoC container. The ApplicationContext interface is superset of BeanFactory implement

... or JaxRpcProxyFactory classes. That enables remote access to existing applications very easy. Even old java objects can be wrapped in Stateless EJB’s. ...

7. What is IOC container in Spring Framework
(Java EE Tips/Spring Framework)
The bean factory concept is foundation of Spring as an IOC container. IOC takes the responsibility for making things happen into the framework away from application code. Programmer needs to just conf

...programmer usually implements logging functionality by putting logger statements in all your methods of Java classes. In an AOP approach one can instead modularize the logging services and apply them ...

...attern types for IOC used by SpringFramework are as follows: Dependencies can be assigned through JavaBeans properties (setter methods). Dependencies are provided as constructor parameters and...

10. What are spring framework and its different parts
(Java EE Tips/Spring Framework)
Spring is a complete j2ee framework having following features Spring Core: Most basic part of framework that provides IOC and dependency injection features .The most basic part is BeanF

11. Tip to set up Environment using JAX RPC
(Java EE Tips/Web Services)
For Sun Based JAX RPC Services you need following. NetBeans IDE 5.0 Sun Java System Application Server Platform Edition 8 2005Q1 Java Standard Development Kit (JDKTM) version 1.4.2 or high

...s C# as the development language for Web services and .NET framework. Sun Microsystems has JAX/RPC (Java API for XML Remote Procedure Calls) and JAXR (Java API for XML Registries). IBM also ha...

13. Why Web Services are needed in Industry
(Java EE Tips/Web Services)
Basically Web services mitigate the application integration crisis. It helps integrating applications at a significantly lower price point than any other integration technology. It’s a new kind o

14. What is Simple Object Access Protocol
(Java EE Tips/Web Services)
This protocol is used to initiate communication to UDDI service. A SOAP based application creates a request block in XML, and then it passes that to the service In Simple Words SOAP is a protocol for

15. What is UDDI Protocol
(Java EE Tips/Web Services)
In simple words this is a way for describing available Web services components. It allows Different web Services to register with an internet Directory that helps to advertise web services So one ca

16. What is a Web Service
(Java EE Tips/Web Services)
Web Service is an application that provides web API to communicate using XML and the Web. Web services makes distributed computer architecture made up of many different machines on different platform

17. Two new tutorials about Servlet Listeners
(Newsflashes/NewsFlashes)
We have published two new tutorials about Servelt listeners: Introduction to Servlet Listener using NetBeans Introduction to Servlet Listener using Eclipse

18. How to read a String line by line
(Java SE Tips/java.io)
Assume that you have a text area and you want to process its content line by line. In such a case you can easily use StringReader class. The follwoing example shows how to print the first charact

...nection with SSL, the connection is established via SSL. package org.javatipsjavaemaillistimporter; import com.sun.mail.pop3.POP3SSLStore; import ja...

20. How to crop a subimage from an image
(Java SE Tips/java.awt.image)
... can use the following code to crop a subimage from an image. import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.i...

... Listener is one of the most popular technologies used in the J2EE web application. It is part of the Java Servlet as defined in Servlet 2.3 but they have their own specific functionalities. There a...

... Listener is one of the most popular technologies used in the J2EE web application. It is part of the Java Servlet as defined in Servlet 2.3 but they have their own specific functionalities. There a...

23. Limit a TextField to Uppercase
(Java SE Tips/java.awt)
import java.awt.*; import java.awt.event.*; public class UpperTF extends Frame {         &nbs

... may want to customize the port number for your machine. [JustOneServer.java]          import java.io.*; import ...

25. Use arrays
(Other API Tips/JNI)
JNI provides special functions (relative to the type) to access Java arrays. This example returns the maximum of an int array. JNIEXPORT jint JNICALL Java_JavaHowTo_max(JNIEnv * env, jclass

26. Determine the signature of a method
(Other API Tips/JNI)
Before calling a Java object's method from JNI, we need its signature. For example, the method long myMethod (int n, String s, int[] arr); is seen from JNI with the signature (I

27. Set the computer clock
(Other API Tips/JNI)
Define the following prototype in the header file JNIEXPORT void JNICALL Java_JavaHowTo_setSystemTime (JNIEnv *, jobject, jshort, jshort); the JNI function JNIEXPORT void JNICALL J

28. Have a Java button close the browser window
(Java SE Tips/java.applet)
...s how to close the browser window when user presses a button. import java.applet.*; import java.awt.*; import java.awt.event.*; import netscape....

29. Call events on a Frame from a Panel
(Java SE Tips/java.awt.event)
...trigger a request to close the Frame and the application. [TestEventPanel.java] import java.awt.*; import java.awt.event.*; public class T...

30. Detect the mouse button used when clicking
(Java SE Tips/java.awt.event)
...detect which mouse button (left, middle or right) is clicked. import java.applet.*; import java.awt.*; import java.awt.event.*; public class&...

31. Make a TextArea word-wrap
(Java SE Tips/java.awt)
Simply create the TextArea with no horizontal scrollbar. myTextArea = new TextArea("text", 3 , 100 , TextArea.SCROLLBARS_VERTICAL_ONLY);

32. Do rubber-band drawing in Java
(Java SE Tips/java.awt)
The following code snippet shows how to implement rubber-drawing with Java. import java.applet.*; import java.awt.*; import java.util.Vector; publ

33. React to the ENTER key in a Textfield
(Java SE Tips/java.awt.event)
import java.applet.*; import java.awt.*; import java.awt.event.*; public class testENTER extends Applet implements KeyLi

... to convert a RGB values of a color into hexadecimal version. import java.awt.*; public class Color2Hex {   public static v...

35. Make the ENTER key act like the TAB key
(Java SE Tips/javax.swing)
...eld that listen to the Enter and react like a Tab key [JDK11] import java.awt.*; import java.awt.event.*; public class MyTextField extends...

36. Have a popup attached to a JTree
(Java SE Tips/javax.swing)
This Java tips shows how to attach a popup menu to a JTree. import javax.swing.*; import javax.swing.tree.*; import java.awt.event.*; import jav

37. Read a data file into a JTable
(Java SE Tips/javax.swing)
...to define the data structure to used by the JTable. [DataFileTableModel.java] import javax.swing.*; import javax.swing.table.*; import javax.swing....

...be called when the Observable object send a notification). [DataFileTable.java] import javax.swing.*; import java.awt.event.*; import java.awt.*; i...

39. Apply special filter to a JTextField
(Java SE Tips/javax.swing)
... a JTextField to filter numeric or alphanumeric characters. import javax.swing.text.*; public class JTextFieldFilter extends PlainDocument...

40. Limit JTextField input to a maximum length
(Java SE Tips/javax.swing)
... tip shows how to limit JTextField input to a maximum length. import javax.swing.text.*; public class JTextFieldLimit extends PlainDocument&...

41. Validate a value on the lostFocus event
(Java SE Tips/javax.swing)
...ne with invokeLater method of the SwingUtilities class.  import java.awt.*;   import java.awt.event.*;  import javax.swing.*; ...

.... From there, simply request the focus for the JTextField. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class&...

43. Keep the console open after execution
(Java SE Tips/java.io)
...l the static method PressAnykey to keep to "DOS" window open. import java.io.*; public class IO {      public static...

44. Pass an Array between Java and Javascript
(Java SE Tips/java.applet)
Javascript can read directly a Java Array but the other way don't seem be true. NOTE : Reading a Java array from Javascript may crash your browser for some unknown reason. So it's safer to use the n

45. Set Applet PARAM VALUE from javascript
(Java SE Tips/java.applet)
PARAM VALUE can't be changed ar run-time but during layout time, javascript "entities" can be used to set calculated VALUES. In this How-to, VALUES are coming from a javascript variable, a javascr

46. Make a JAR executable
(Java SE Tips/java.lang)
...The class must have a main(). Try with this simple class: import java.awt.*; import java.awt.event.*; public class MyClass {  p...

47. Control a thread from outside
(Java SE Tips/java.lang)
This tips shows a structure for threads which allows you to control execution of them outside easily. public class TT extends Thread {  st

48. Pause the execution
(Java SE Tips/java.lang)
You can pause the execution of your program/thread using sleep() method of Thread class. The example below shows how to do this: public class Wait { &nb

49. Set the memory available to the JVM
(Java SE Tips/java.lang)
...nding "m" to n will specified the number in megabytes, for example to set the maximum at 20Mb: java -mx 20m myApp . -ms n Sets the startup size of the memory allocation pool, where n is ...

50. Add/Substract Day/Month/Year to a Date
(Java SE Tips/java.util)
..."rolls over". String DATE_FORMAT = "yyyy-MM-dd"; java.text.SimpleDateFormat sdf =        new ...

Too many pages.