Browsing all posts in "string".

Tables in Java

This program was generated with very little code. All we did was set up a JTable object with a String[][] argument for the table data and a String[] argument for the table’s headers. Rather than adding the table itself directly to our window, we enclose it in a scrollpane:
here the code:
// SimpleTable.java
// A test [...]

Progress Bar

In this seasion we try to make progress bar using Jframe. The progress bar is use to identify progress in visual. With it user can see what the program realy running or how far it running
this source code:
import javax.swing.*;
/**
* Demo progress bar
*
* @author indrarusadie
*
*/
public class Main extends JFrame {
[...]

Generate Random String and Number

In this moment we try to use java.lang.math and java.util.Random class
With this class we can make script code to generate String and number
Source code 1:
public class random1 {
public static short random() {
return (short)(Math.floor(Math.random() * 100) + 0);
}
public static void main(String[] args) {
System.out.println(random());
[...]