turunan dan convert

double to string:

public class ConvertDoubleToString
{
public static void main(String[] args)
{
double aDouble = 0.11;
String aString = Double.toString(aDouble);
}
}



public class System.Web.UI.Page
{
protected void ResultButton_Click(Object sender, EventArgs [] e)
{
double numberone = Double.Parse(Num1TextBox.Text);
double numbertwo = Double.Parse(Num2TextBox.Text);

double hasil=numberone + numbertwo;
ResultLabel.Text = Convert.ToString(hasil);


}
}



import javax.swing.*;
import java.awt.*;

public class eko {
public eko (){
}

public static void main (String []args){


JFrame frame = new JFrame("Test JFRAME");
frame.setBackground(new Color (214,214,20));
frame.setBounds(10,10,200,200);
frame.setFocusable(true);
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JLabel label = new JLabel("tabel");
frame.add(label);

}
}




import javax.swing.*;
import java.awt.*;

public class window1 {

public window1() {
}

public static void main (String[] args) {

JFrame frame = new JFrame("Test JFRAME");
frame.setBackground(new Color(214,214,20));
frame.setBounds(10,10,200,200);
frame.setFocusable(true);
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JLabel label = new JLabel("tabel");
frame.add(label);
}

}




import javax.swing.*;
import java.awt.*;


public class window2 extends JFrame{

public window2() {
loadcomponent();
}

private void loadcomponent()
{
JTextField field1 = new JTextField(20);
JLabel label1 = new JLabel("Nama");
setBounds(2,2,200,200);
add(field1);
add(label1);
setVisible(true);
setBackground(new Color(2,2,2));
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void main (String[] args) {
window2 a =new window2();
}
}

0 komentar:

Posting Komentar

Template by : kendhin x-template.blogspot.com