Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog
Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Statistics
Registered Users:
770
Java SE Tips:
614
Java ME Tips:
201
Java EE Tips:
184
Other API Tips:
779
Java Applications:
298
Java Libraries:
209
Java Games:
16
Book Reviews:
Search
Search Keyword:
Any words
All words
Exact phrase
Ordering:
Newest first
Oldest first
Most popular
Alphabetical
Section/Category
Search Keyword
system class
Total 50 results found. Search for [
system class
] with
Results 1 - 50 of 50
5
10
15
20
25
30
50
1.
How to read a String line by line
(Java SE Tips/java.io)
... if (str.length() > 0)
System
.out.println(str.charAt(0)); &nb...
2.
Connecting GMail using POP3 connection with SSL
(Other API Tips/JavaMail)
...e(int messageNo) throws Exception {
System
.out.println("Getting message number: " + messageNo); ...
3.
How to crop a subimage from an image
(Java SE Tips/java.awt.image)
... {
System
.out.println("raster format error: " + rfe.getMessage()...
4.
Introduction to Servlet Listener using Eclipse
(Java Tutorials/Tutorials)
...;public void contextInitialized(ServletContextEvent arg0) {
System
.out.println("Servlet Context is initialized....");  ...
5.
Introduction to Servlet Listener using NetBeans
(Java Tutorials/Tutorials)
...;public void contextInitialized(ServletContextEvent arg0) {
System
.out.println("Servlet Context is initialized....");  ...
6.
Limit a TextField to Uppercase
(Java SE Tips/java.awt)
... {
System
.exit(0); } ...
7.
Preventing multiple instances of an application
(Java SE Tips/java.lang)
... //
System
.out.println("*** Got a connection! "); ...
8.
Use arrays
(Other API Tips/JNI)
...sp; static {
System
.loadLibrary("javahowto"); } } ...
9.
Set the computer clock
(Other API Tips/JNI)
Define the following prototype in the header file JNIEXPORT void JNICALL Java_JavaHowTo_set
System
Time (JNIEnv *, jobject, jshort, jshort); the JNI function JNIEXPORT void JNICALL J
10.
Call events on a Frame from a Panel
(Java SE Tips/java.awt.event)
...;(ae.getSource()==p1.b1) {
System
.out.println(ae.getActionCommand()); &...
11.
Detect the mouse button used when clicking
(Java SE Tips/java.awt.event)
...p; case InputEvent.BUTTON1_MASK: {
System
.out.println("That's the LEFT button"); &n...
12.
React to the ENTER key in a Textfield
(Java SE Tips/java.awt.event)
...kit.getDefaultToolkit().beep();
System
.out.println("ENTER pressed"); ...
13.
Convert RGB value to Hexadecimal - To be used in HTML for example
(Java SE Tips/java.awt)
... if (args.length != 3) {
System
.out.println("Color2Hex r g b"); ...
14.
Have a popup attached to a JTree
(Java SE Tips/javax.swing)
...sp; win.setVisible(false);
System
.exit(0); } }
class
MyJTree extends JTre...
15.
Read a data file into a JTable
(Java SE Tips/javax.swing)
...sp; win.setVisible(false);
System
.exit(0); } } ...
16.
Read a data file into a JTable and reload if data file have changed
(Java SE Tips/javax.swing)
...sp; win.setVisible(false);
System
.exit(0); } } The DataFileW...
17.
Validate a value on the lostFocus event
(Java SE Tips/javax.swing)
...when the lostFocus occurs on a Component, the gainedFocus is already sent for the next component in the
System
EventQueue. We must grab this event, and request the focus for the previous component ...
18.
Keep the console open after execution
(Java SE Tips/java.io)
...put = new BufferedReader(new InputStreamReader(
System
.in));
System
.out.print("Press any key..."...
19.
Make a JAR executable
(Java SE Tips/java.lang)
...{
System
.exit(0); &nbs...
20.
Pause the execution
(Java SE Tips/java.lang)
...p; public static void main(String args[]) {
System
.out.println("Wait one second"); Wait....
21.
Add/Substract Day/Month/Year to a Date
(Java SE Tips/java.util)
...Calendar.getInstance(); c1.set(1999, 0 , 20); // 1999 jan 20
System
.out.println("Date is : " + sdf.format(c1.getTime())); ...
22.
Compare two dates
(Java SE Tips/java.util)
...bsp; c2.set(1999, 0 , 30);
System
.out.print(sdf.format(c1.getTime())); &nb...
23.
Post a message on a news server using NNTP protocol
(Java SE Tips/java.net)
..."); PrintStream p = c.startPost();
System
.out.println("Starting post at " + args[0] + ...
24.
Read messages from a news server
(Java SE Tips/java.net)
...;BufferedReader(new InputStreamReader(anArticle));
System
.out.println("-----------------\nArticle " + i); &n...
25.
Get a list of headers from a newsgroup
(Java SE Tips/java.net)
...nbsp; String theLine;
System
.out.println("-----------------\nHeader " + i + "/&...
26.
Get a list of all available newsgroup from a news server
(Java SE Tips/java.net)
...er = "news"; try {
System
.out.println("opening server"); NntpC...
27.
Compute days between 2 dates
(Java SE Tips/java.util)
...; Integer.parseInt(args[5]), 0, 0, 0);
System
.out.println (daysBetween(c1.getTime(),c2.ge...
28.
Get the Date from server
(Java SE Tips/java.net)
...(String args[]) { if (args.length != 1) {
System
.out.println("Usage: GetTime HOST"); return; &nb...
29.
Latest Additions - 17.07.06 (389 new tips)
(Newsflashes/NewsFlashes)
...re screenshot How to use AWT CardLayout How to use Robot
class
in Java Java Graphics Coordinate
System
Converting RGB colors into values of hue saturation and intensity How to use Bord...
30.
Get the last-modified date from a file
(Java SE Tips/java.io)
Simply use the lastModified() method from a file object. but the return value is
system
dependent and should only be used to compare with other values returned by last modified. It should not be int
31.
Check if a file exists
(Java SE Tips/java.io)
...bsp;{ File f = new File(args[0]);
System
.out.println (f + (f.exists()? "...
32.
Delete files with a certain extension
(Java SE Tips/java.io)
...p;public static void main (String args[]) {
System
.out.println("hello"); delfile td =&nb...
33.
Read a file into a variable in one shot
(Java SE Tips/java.io)
...#34;); /* */
System
.out.println(result); } ...
34.
Read a text file from a jar
(Java SE Tips/java.io)
...readLine()) != null) {
System
.out.println(thisLine); } &nbs...
35.
Redirect standard output to a file
(Java SE Tips/java.lang)
This tip shows how to redirect standard output (stdout) to a file.
System
.setOut( new PrintStream( ne
36.
Check if a page exists
(Java SE Tips/java.net)
...heck { public static void main(String s[]) {
System
.out.println(exists("http://www.java-tips.org/home/")); &nbs...
37.
Get the content of a directory with subdirectories
(Java SE Tips/java.io)
...nbsp; if (arg.length > 0) {
System
.out.println("recursive Dirs from " + arg[0]); ...
38.
Get the content of a directory with a Filter
(Java SE Tips/java.io)
... if (args.length != 1) {
System
.err.println ("usage: java Filter ex. java ...
39.
Access parameters passed in the URL
(Java SE Tips/java.applet)
...int i; String completeURL = getDocumentBase().toString();
System
.out.println("Complete URL: " + completeURL); ...
40.
Get the user name
(Java SE Tips/java.lang)
...or it or use a signed applet. String username; username =
System
.getProperty("user.name"); ...
41.
Output french characters to the console
(Java SE Tips/java.io)
...edWriter (new OutputStreamWriter(
System
.out, "Cp850")); w.write(javaString);...
42.
Wrap a Java beans in a COM object
(Other API Tips/JNI)
...u execute it from the sun.beans.ole package. The Java Plug-in 1.2 and the JDK1.2 must be installed on the
system
(for download, see Java Sun Web site). Let's try it with this simple
class
: ...
43.
Wrap a Java class in a COM object
(Other API Tips/JNI)
... The
class
can compiled with any JDK but the actual execution will use the Microsoft JVM installed on the
system
. The javareg utility is part of the Microsoft Java SDK which can be freely download...
44.
Create a Java source dynamically, compile and call
(Java SE Tips/java.lang)
...); if (mtc.compileIt()) {
System
.out.println("Running " + mtc.today
Class
+ ":\n\n...
45.
Access the enclosing class from an inner class
(Java SE Tips/java.lang)
... } public void enclosing
Class
Method(){
System
.out.println("Hello world!"); } &nb...
46.
Calling a method dynamically using reflection
(Java SE Tips/java.lang.reflect)
...bsp; // call the method
System
.out.println(thisMethod.invoke(i
Class
, paramsObj).toString()); ...
47.
Replace or remove character in a String
(Java SE Tips/java.lang)
...sp;"; String tmpString = myString.replace( '\'', '*' );
System
.out.println( "Original = " + myString );
System
...
48.
Use a Hashtable
(Java SE Tips/java.util)
... String[] resultArray = (String[])(arrays.get("Array2"));
System
.out.println (resultArray[0] + ", "&nbs...
49.
Have an applet launch another applet
(Java SE Tips/java.applet)
...sp;} catch (Exception e) {
System
.out.println( e ); }  ...
50.
How to use an INI file
(Java SE Tips/java.util)
...p; p.load(new FileInputStream("user.ini"));
System
.out.println("user = " + p.getProperty("DBuser")); ...
<< Start
< Prev
1
Next >
End >>
Home
-
About Us
-
Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.