Page 9 of 9 FirstFirst ... 56789
Results 121 to 131 of 131
http://idgs.in/80433
  1. #121
    bguez's Avatar
    Join Date
    Aug 2011
    Location
    Surabaya
    Posts
    7,594
    Points
    698.49
    Thanks: 17 / 67 / 52

    Default

    Quote Originally Posted by sibabiganja View Post
    capture pict dr web ato gmn ?
    bukan dari web gan..
    tp buat manual lwt aplikasi java langsung..
    ada yg tau enggk??

  2. Hot Ad
  3. #122
    sibabiganja's Avatar
    Join Date
    Jul 2009
    Location
    indonesia
    Posts
    1,425
    Points
    112.71
    Thanks: 10 / 37 / 27

    Default

    import java.awt.AWTException;
    import java.awt.Robot;
    import java.awt.Rectangle;
    import java.awt.Toolkit;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;

    class ScreenCapture {
    public static void main(String args[]) throws
    AWTException, IOException {
    // capture the whole screen
    BufferedImage screencapture = new Robot().createScreenCapture(
    new Rectangle(Toolkit.getDefaultToolkit().getScreenSiz e()) );

    // Save as JPEG
    File file = new File("screencapture.jpg");
    ImageIO.write(screencapture, "jpg", file);

    // Save as PNG
    // File file = new File("screencapture.png");
    // ImageIO.write(screencapture, "png", file);
    }
    }

    moga2 bisa ..dan kode diatas buat screen capture...kyk screenshot spertinya..blom coba lg >..<

  4. #123
    bguez's Avatar
    Join Date
    Aug 2011
    Location
    Surabaya
    Posts
    7,594
    Points
    698.49
    Thanks: 17 / 67 / 52

    Default

    Quote Originally Posted by sibabiganja View Post
    import java.awt.AWTException;
    import java.awt.Robot;
    import java.awt.Rectangle;
    import java.awt.Toolkit;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;

    class ScreenCapture {
    public static void main(String args[]) throws
    AWTException, IOException {
    // capture the whole screen
    BufferedImage screencapture = new Robot().createScreenCapture(
    new Rectangle(Toolkit.getDefaultToolkit().getScreenSiz e()) );

    // Save as JPEG
    File file = new File("screencapture.jpg");
    ImageIO.write(screencapture, "jpg", file);

    // Save as PNG
    // File file = new File("screencapture.png");
    // ImageIO.write(screencapture, "png", file);
    }
    }

    moga2 bisa ..dan kode diatas buat screen capture...kyk screenshot spertinya..blom coba lg >..<
    uda sempet coba ni gw,lmyn dah buat tambah2 ilmu dikit.
    tapi tadi pas nyoba da yg error gara2 hurufnya pisah,tuh yg gw bold
    hehehe

  5. #124
    sherri's Avatar
    Join Date
    Feb 2012
    Location
    Blank infinity.
    Posts
    18
    Points
    26.60
    Thanks: 0 / 1 / 1

    Default

    udh g make tanda petik masih ga bisa juga ni om

  6. #125

    Join Date
    Oct 2012
    Posts
    34
    Points
    52.40
    Thanks: 7 / 0 / 0

    Default

    Gw share codingan bikin kalkulator nih biasanya awal" kuliah pasti keluar yang satu ini. buat yang mau tanya taya boleh

  7. #126

    Join Date
    Oct 2012
    Posts
    34
    Points
    52.40
    Thanks: 7 / 0 / 0

    Default

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

    public class kalkulator extends JFrame implements ActionListener{
    JLabel ang1 = new JLabel();
    JLabel ang2 = new JLabel();
    JLabel hasil = new JLabel();
    JLabel a = new JLabel();
    JLabel b = new JLabel();
    JLabel c = new JLabel();
    JTextField txtang1 = new JTextField();
    JTextField txtang2 = new JTextField();
    JTextField txthasil = new JTextField();
    JButton kali = new JButton("X");
    JButton bagi = new JButton("/");
    JButton tambah = new JButton("+");
    JButton kurang = new JButton("-");
    JButton exit = new JButton("Keluar");

    public kalkulator(){
    this.getContentPane().setLayout(null);
    this.setTitle("APP KALKULATOR");

    ang1.setText("ANGKA 1");
    ang1.setFont(new Font("Arial",Font.BOLD,14));
    ang1.setBounds(new Rectangle(20,8,150,22));
    this.getContentPane().add(ang1);

    ang2.setText("ANGKA 2");
    ang2.setFont(new Font("Arial",Font.BOLD,14));
    ang2.setBounds(new Rectangle(20,38,150,22));
    this.getContentPane().add(ang2);

    hasil.setText("HASIL");
    hasil.setFont(new Font("Arial",Font.BOLD,14));
    hasil.setBounds(new Rectangle(20,68,150,22));
    this.getContentPane().add(hasil);

    a.setText(":");
    a.setFont(new Font("Arial",Font.BOLD,14));
    a.setBounds(new Rectangle(100,8,5,22));
    this.getContentPane().add(a);

    b.setText(":");
    b.setFont(new Font("Arial",Font.BOLD,14));
    b.setBounds(new Rectangle(100,38,5,22));
    this.getContentPane().add(b);

    c.setText(":");
    c.setFont(new Font("Arial",Font.BOLD,14));
    c.setBounds(new Rectangle(100,68,5,22));
    this.getContentPane().add(c);

    txtang1.setBounds(new Rectangle(125,8,150,22));
    this.getContentPane().add(txtang1);

    txtang2.setBounds(new Rectangle(125,38,150,22));
    this.getContentPane().add(txtang2);

    txthasil.setBounds(new Rectangle(125,68,150,22));
    this.getContentPane().add(txthasil);

    kali.setBounds(new Rectangle(40,100,50,50));
    this.getContentPane().add(kali);
    kali.addActionListener(this);

    bagi.setBounds(new Rectangle(95,100,50,50));
    this.getContentPane().add(bagi);
    bagi.addActionListener(this);

    tambah.setBounds(new Rectangle(150,100,50,50));
    this.getContentPane().add(tambah);
    tambah.addActionListener(this);

    kurang.setBounds(new Rectangle(205,100,50,50));
    this.getContentPane().add(kurang);
    kurang.addActionListener(this);

    exit.setBounds(new Rectangle(95,160,110,22));
    this.getContentPane().add(exit);
    exit.addActionListener(this);

    }
    public void actionPerformed(ActionEvent ae){
    if(ae.getSource()==exit)
    {
    setVisible(false);
    }
    else if(txtang1.getText().equals("") && txtang2.getText().equals("")){
    JOptionPane.showMessageDialog(null,"Maaf Kamu Belum Memasukan Angka Pertama dan Angka Kedua!","Dialog Peringatan", JOptionPane.WARNING_MESSAGE);
    }
    else if(txtang1.getText().equals("")){
    JOptionPane.showMessageDialog(null,"Maaf Kamu Belum Memasukan Angka Pertama!","Dialog Peringatan", JOptionPane.WARNING_MESSAGE);
    }
    else if(txtang2.getText().equals("")){
    JOptionPane.showMessageDialog(null,"Maaf Kamu Belum Memasukan Angka Kedua!","Dialog Peringatan", JOptionPane.WARNING_MESSAGE);
    }
    else{
    double a1, a2, hasil;
    a1=Double.parseDouble(txtang1.getText());
    a2=Double.parseDouble(txtang2.getText());
    if (ae.getSource()==kali){
    hasil=a1*a2;
    txthasil.setText(""+ hasil);
    }
    if (ae.getSource()==bagi)
    {
    hasil=a1/a2;
    txthasil.setText(""+ hasil);
    }
    if (ae.getSource()==tambah)
    {
    hasil=a1+a2;
    txthasil.setText(""+ hasil);
    }
    if (ae.getSource()==kurang)
    {
    hasil=a1-a2;
    txthasil.setText(""+ hasil);
    }
    }
    }

    public static void main(String[] args) {
    kalkulator a = new kalkulator();
    a.setSize(315,230);
    a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    a.setVisible(true);
    }
    }

  8. #127

    Join Date
    Oct 2012
    Posts
    34
    Points
    52.40
    Thanks: 7 / 0 / 0

    Default

    Nah kalo yang ini buat ngukur suhu. cekidooooot

  9. #128

    Join Date
    Oct 2012
    Posts
    34
    Points
    52.40
    Thanks: 7 / 0 / 0

    Default

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

    public class suhu extends JFrame implements ActionListener{
    JLabel celcius = new JLabel("SUHU (C)");
    JLabel hasil = new JLabel("HASIL");
    JLabel a = new JLabel(":");
    JLabel b = new JLabel(":");
    JRadioButton rfah = new JRadioButton("FAHRENHEIT");
    JRadioButton rkel = new JRadioButton("KELVIN");
    JTextField txtcelcius = new JTextField();
    JTextField txthasil = new JTextField();
    JButton exit = new JButton("KELUAR");
    JButton hitung = new JButton("HITUNG");

    public suhu() {
    this.getContentPane().setLayout(null);
    this.setTitle("APP PENGHITUNG SUHU");

    ButtonGroup bg = new ButtonGroup();
    bg.add(rfah);
    bg.add(rkel);

    rfah.setBounds(new Rectangle(45,8,120,22));
    rfah.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(rfah);
    rkel.setBounds(new Rectangle(165,8,120,22));
    rkel.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(rkel);

    celcius.setBounds(new Rectangle(25,35,100,22));
    celcius.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(celcius);
    hasil.setBounds(new Rectangle(25,62,100,22));
    hasil.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(hasil);
    a.setBounds(new Rectangle(110,35,5,22));
    a.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(a);
    b.setBounds(new Rectangle(110,62,5,22));
    b.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(b);

    txtcelcius.setBounds(new Rectangle(120,35,150,22));
    txtcelcius.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(txtcelcius);
    txthasil.setBounds(new Rectangle(120,62,150,22));
    txthasil.setFont(new Font("Arial",Font.BOLD,14));
    this.getContentPane().add(txthasil);

    hitung.setBounds(new Rectangle(65,100,80,22));
    this.getContentPane().add(hitung);
    hitung.addActionListener(this);
    exit.setBounds(new Rectangle(165,100,80,22));
    this.getContentPane().add(exit);
    exit.addActionListener(this);
    }
    public void actionPerformed(ActionEvent ae) {
    if(ae.getSource()==exit)
    {
    setVisible(false);
    }
    else if(txtcelcius.getText().equals("")){
    JOptionPane.showMessageDialog(null,"Maaf Kamu Belum Memasukan Suhu Yang Akan Dihitung!!","Dialog Peringatan", JOptionPane.ERROR_MESSAGE);
    }
    else{
    double c, hasil;
    c=Double.parseDouble(txtcelcius.getText());
    if(ae.getSource()==hitung && rfah.isSelected()) {
    hasil=(c*1.8)+32;
    txthasil.setText(""+ hasil);
    }
    else {
    hasil=c+273;
    txthasil.setText(""+ hasil);
    }
    }
    }

    public static void main(String[] args) {
    suhu a = new suhu();
    a.setSize(315,180);
    a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    a.setVisible(true);
    }
    }

  10. #129
    SPONGERS's Avatar
    Join Date
    Sep 2009
    Location
    MALANG KOTA MALANG
    Posts
    5,739
    Points
    2,114.85
    Thanks: 86 / 155 / 139

    Default

    ^ itu mah di google banyak , sm persis

    btw ada yg bisa bantuin gw benahin SC ini ga ?
    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package matkom;
    import java.util.Scanner;
    
    /**
     *
     * @author Oktafianza
     */
    public class tugasmaenkripsi {
        public static void main(String[]Args){
            Scanner G=new Scanner(System.in);
            String a;
            
            
            String [][] tabel= {{"h","n","c","r","k"},{"d","t","s","w","l"},{"p","dh","j","y","ny"},{"m","g","b","th","ng"}};
            
            System.out.println("Masukkan Kalimat: ");
            a= G.nextLine();
            
            for(int i=0; i<=a.length()-1; i++){
             char s= a.charAt(i);
           
              if(s=='a'){
                  System.out.print("a");
              }if(s=='i'){
                  System.out.print("i");
              }if(s=='u'){
                  System.out.print("u");
              }if(s=='e'){
                  System.out.print("e");
              }if(s=='o'){
                  System.out.print("o");
              }if(s=='f'){
                  System.out.print("f");
              }if(s=='h'){
                  System.out.print(tabel[2][0]);
              }if(s=='n'){
                  System.out.print(tabel[2][1]);
              }if(s=='c'){
                  System.out.print(tabel[2][2]);
              }if(s=='r'){
                  System.out.print(tabel[2][3]);
              }if(s=='k'){
                  System.out.print(tabel[2][4]);
              }if(s=='d'){
                  System.out.print(tabel[3][0]);
              }if(s=='t'){
                  System.out.print(tabel[3][1]);
              }if(s=='s'){
                  System.out.print(tabel[3][2]);
              }if(s=='w'){
                  System.out.print(tabel[3][3]);
              }if(s=='l'){
                  System.out.print(tabel[3][4]);
              }if(s=='p'){
                  System.out.print(tabel[0][0]);
              }if(s=='j'){
                  System.out.print(tabel[0][2]);
              }if(s=='y'){
                  System.out.print(tabel[0][3]);
              }if(s=='m'){
                  System.out.print(tabel[1][0]);
              }if(s=='g'){
                  System.out.print(tabel[1][1]);
              }if(s=='b'){
                  System.out.print(tabel[1][2]);}}
            
     
            
                  }  
                    
                }



    kalo gue input

    wibi suka gisel

    output nya

    thisibunyatibeng

    tapi ketika gue input

    thisibunyatibeng

    hasilnya

    gpibisudhragisedht , jadinya beda

    harusnya
    gp==w
    drh==k
    dht==l

    tugas gue hampir sama kayak disini http://www.ojonesu.com/dagadu.html
    follow me @oktafianza

  11. #130
    (OA-)'s Avatar
    Join Date
    Mar 2013
    Posts
    31
    Points
    1.90
    Thanks: 0 / 0 / 0

    Default

    ini dia pelajaran yg paling susah masuk di otak gue
    sampe2 gue putus kuliah
    tapi menurut gue , kalo kita bisa nguasai JAVA pasti asik dah

  12. #131
    RyougiShiki's Avatar
    Join Date
    Jan 2012
    Location
    Cimahi
    Posts
    511
    Points
    1.30
    Thanks: 34 / 90 / 66

    Default

    Quote Originally Posted by SPONGERS View Post
    ^ itu mah di google banyak , sm persis

    btw ada yg bisa bantuin gw benahin SC ini ga ?
    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package matkom;
    import java.util.Scanner;
    
    /**
     *
     * @author Oktafianza
     */
    public class tugasmaenkripsi {
        public static void main(String[]Args){
            Scanner G=new Scanner(System.in);
            String a;
            
            
            String [][] tabel= {{"h","n","c","r","k"},{"d","t","s","w","l"},{"p","dh","j","y","ny"},{"m","g","b","th","ng"}};
            
            System.out.println("Masukkan Kalimat: ");
            a= G.nextLine();
            
            for(int i=0; i<=a.length()-1; i++){
             char s= a.charAt(i);
           
              if(s=='a'){
                  System.out.print("a");
              }if(s=='i'){
                  System.out.print("i");
              }if(s=='u'){
                  System.out.print("u");
              }if(s=='e'){
                  System.out.print("e");
              }if(s=='o'){
                  System.out.print("o");
              }if(s=='f'){
                  System.out.print("f");
              }if(s=='h'){
                  System.out.print(tabel[2][0]);
              }if(s=='n'){
                  System.out.print(tabel[2][1]);
              }if(s=='c'){
                  System.out.print(tabel[2][2]);
              }if(s=='r'){
                  System.out.print(tabel[2][3]);
              }if(s=='k'){
                  System.out.print(tabel[2][4]);
              }if(s=='d'){
                  System.out.print(tabel[3][0]);
              }if(s=='t'){
                  System.out.print(tabel[3][1]);
              }if(s=='s'){
                  System.out.print(tabel[3][2]);
              }if(s=='w'){
                  System.out.print(tabel[3][3]);
              }if(s=='l'){
                  System.out.print(tabel[3][4]);
              }if(s=='p'){
                  System.out.print(tabel[0][0]);
              }if(s=='j'){
                  System.out.print(tabel[0][2]);
              }if(s=='y'){
                  System.out.print(tabel[0][3]);
              }if(s=='m'){
                  System.out.print(tabel[1][0]);
              }if(s=='g'){
                  System.out.print(tabel[1][1]);
              }if(s=='b'){
                  System.out.print(tabel[1][2]);}}
            
     
            
                  }  
                    
                }



    kalo gue input

    wibi suka gisel

    output nya

    thisibunyatibeng

    tapi ketika gue input

    thisibunyatibeng

    hasilnya

    gpibisudhragisedht , jadinya beda

    harusnya
    gp==w
    drh==k
    dht==l

    tugas gue hampir sama kayak disini http://www.ojonesu.com/dagadu.html

    inget loh itu >IF< nya kebanyakan
    tapi normal sih soalnya ngak ada konflik kaya > keluar 2 terus si 2 nya di proses lagi dan jadilah output yang ngaco.

    harusnya si gini gw ngetik ampas tahu jadi sapma uhat
    tapi bisa juga uhat sapma

    kalo mau jadi sapma uhat lu buat 2 proses dan bakal jadi output yang berbeda
    tapi kalo 1 ya sama aj

    sebernya si g usah ada
    Code:
    String [][] tabel= {{"h","n","c","r","k"},{"d","t","s","w","l"},{"p","dh","j","y","ny"},{"m","g","b","th","ng"}};
    nih gw kasih logikanya "huruf terakhir = huruf pertama"

    tapi tgg dl... gw pgn tanya tugasnya ini utk apa =_= dan ngebuat apa
    dan apa itu dagadu
    wkwkwkkw
    Last edited by RyougiShiki; 19-03-13 at 22:27.

Page 9 of 9 FirstFirst ... 56789

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •