<properties>
<my_Constant_String>com.gt.App</my_Constant_String>
</properties>
Use : <some_property_tag>${my_Constant_String}</some_property_tag>
<properties>
<my_Constant_String>com.gt.App</my_Constant_String>
</properties>
Use : <some_property_tag>${my_Constant_String}</some_property_tag>
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class ScreenLogger {
private static final String saveLocation = "c:\\logs\\";
private static final int timeInterval = 1000 * 30;
private static Rectangle rect;
private static Robot robot;
public static void main(String[] args) throws Exception {
init();
new Thread(new CaptureThread()).start();
}
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.ServiceRecord;
import javax.bluetooth.UUID;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.io.StreamConnectionNotifier;
public class BtCommunication {
private StreamConnectionNotifier scn=null;
private DiscoveryAgent mDiscoveryAgent=null;
private StreamConnection conn = null;
private InputStream inputStream=null;
String cmd = "cmd.exe /c start ";
String file = "c:\\";
Runtime.getRuntime().exec(cmd + file);
public class ChessGUI extends JFrame {
private Board board;
private ChessGUI() {
board = new Board();
setLayout(new FlowLayout());
add(board);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
pack();
}
System.out.println("Google\n" + new Scanner(new URL("http://google.com").openStream())
.useDelimiter("\\A").next());
Reading a text file :System.out.println("TextFile\n"+new Scanner(new File("inputFile.txt"))
.useDelimiter("\\A").next());
The regex "\\A" here matches the beginning of input source. Scanner can work not only with an InputStream source, but with anything that implements the new (JDK version >= 1.5) java.lang.Readable interface.