(Android) Aplikasi Kursus Bonang v1.4

Aplikasi kursus bonang di buat oleh 3 mahasiswa yaitu reky susanto(10) , ariska hidayat (10) dan saya Anna arthdi putra (10), aplikasi ini pernah di ikut sertakan lomba dalam bidang programming mobile , alhamdulilah aplikas ini melanjutkan hingga babak final , lebih tepat nya di kampus satya , aplikasi ini memiliki fitur dengan suara suara bonang jawa , nada nada dasar lah yang menjadikan aplikasi ini di sebut dengan bongang jawa, bila teman teman menginginkan pembelajaran atau bimbingan bisa langsung datang ke site ini http://wartech-id.com dan bisa langsung datang ke kediaman kami .. terima kasih …

1. Tampilan awal aplikasi

2. Tampilan permainan

(Java)Instalation Apache Tomcat for Linux Online or Offline

Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project. To learn more about getting involved, click here.

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.

Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat project logo are trademarks of the Apache Software Foundation.

Instalation Online

1. Open Terminal

2. $sudo apt-get install tomcat7

Instalation Offline

1. Download Apache Tomcat is Here http://tomcat.apache.org/

2. Extract Apache Tomcat For Home or Directory .

3. Open Terminal and write scrip here $ sudo gedit /etc/profile

CATALINA_HOME=/home/name_home/apache-tomcat-7.0.28
export CATALINA_HOME
PATH=$CATALINA_HOME/bin:$PATH
export PATH

and save or CTRL + S

4. write scrip here $sudo gedit /etc/bash/bash.bashrc (Path)

CATALINA_HOME=/home/name_home/apache-tomcat-7.0.28
export CATALINA_HOME
PATH=$CATALINA_HOME/bin:$PATH
export PATH

and save or CTRL + S

5. writel scrip here $sudo chmod 777 -R apache-tomcat-7.0.28/ (Permission)

6. Open folder apache-tomcat-7.0.28 – conf – tomcat-users.xml


7. write terminal $sudo apache-tomcat-7.0.28/bin/startup.sh

8. Open browser and write link http://localhost/8080

9. Finish

(Java)Install ZK_framework for eclipse

ZK is an open-source Ajax Web application framework, written in Java,that enables creation of rich graphical user interfaces for Web applications without the application developer having to write JavaScript (despite the J in Ajax acronym standing for JavaScript) and with little required programming knowledge. The core of ZK consists of an Ajax-based event-driven mechanism, over 123 XUL and 83 XHTML-based components,[5] and a markup language for designing user interfaces. Programmers design their application pages in feature-rich XUL/XHTML components, and manipulate them upon events triggered by end user’s activity. It is similar to the programming model found in desktop GUI-based applications.

ZK takes the so called server-centric approach that the content synchronization of components and the event pipelining between clients and servers are automatically done by the engine and Ajax plumbing codes are completely transparent to web application developers. Therefore, the end users get the similar engaged interactivity and responsiveness as a desktop application, while programmers’ development retains a similar simplicity to that of desktop applications.

Tutorial ZK Framework
ZKoss .org

1. Open eclipse IDE

2. Help – Install New Software

3. Add

Name :zk
location : http://studio.zkoss.org/resource/plugins/eclipse_3_7

4. Next

5. Process Instaling Software ZK

reference : http://books.zkoss.org/wiki/ZK_Studio_Essentials/Installation#Online_Installation

(Java)Ebook Jeni (Java Education Network Indonesia) Full

JENI adalah Java Education Network Indonesia, sebuah program pendidikan aplikatif berbasis Java sebagai bahasa pemrograman yang dideklarasikan oleh Departemen Pendidikan Nasional Republik Indonesia sebagai rangkaian dari program Jejaring Pendidikan Nasional (JARDIKNAS).

Jeny

(Java)Client – Server _ Concurrenct Server

What is a concurrent server?

A server that can handle multiple client requests at the same time, makes multiple copies of itself.

Server


import java.io.DataInputStream;
import java.net.ServerSocket;
import java.net.Socket;
import project.Client.View_Client1;
import project.Model.Model_server;
import project.Server.View_Server;

/**
 *
 * @author root
 */
public class ControlServer {
   View_Server server;
   Model_server model;
   
   public void setModelserver(Model_server model){
       this.model = model;
   }
   
    public void startServer(View_Server Server) {
        
     int port = Integer.parseInt(Server.getPort().getText());
     try{
           ServerSocket ss = new ServerSocket(port);
            while (true) {
              try {
		Socket socket = ss.accept();
                System.out.println("Server connection");
                ServerChild child = new ServerChild(socket);
                child.start();
              } catch (Exception ex) {
               	   System.out.println("client disconnected");
                }
            }
         } catch (Exception ex){
            ex.printStackTrace();
           }
     }
 class ServerChild extends Thread{
        Socket soc;
        ServerChild (Socket p_soc){
            soc = p_soc;
        }
        public void run(){
            try{
               
                DataInputStream dis = new DataInputStream(soc.getInputStream());
                while (true) {
                    String text = dis.readUTF();
                    System.out.println("Pesan = "+ text);
                }
             } catch (Exception ex){
                 System.out.println("Connection closed");
               }
        }
    }
    
}
<pre> 

Client

import java.io.DataOutputStream;
import java.net.Socket;
import project.Client.VIew_Client2;
import project.Model.Model_user2;

/**
 *
 * @author root
 */
public class ControlerUser2 {
    private Model_user2 model;
    private VIew_Client2 view;
    
    public void setModeluser1(Model_user2 model){
        this.model = model;
    }
     public void startClient(VIew_Client2 view) {
        String host = view.getHost().getText();
        int port =Integer.parseInt(view.getPosrt().getText());
        try {
            Socket socket = new Socket(host,port); 
                
            DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
       
                dos.writeUTF("User 1 = "+view.getPesan().getText());
                Thread.sleep(1000);
            
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

<pre> 

OUTPUR

(Java) Throws and Throw

Before you can catch an exception, some code somewhere must throw one. Any code can throw an exception: your code, code from a package written by someone else such as the packages that come with the Java platform, or the Java runtime environment. Regardless of what throws the exception, it’s always thrown with the throw statement.

As you have probably noticed, the Java platform provides numerous exception classes. All the classes are descendants of the Throwable class, and all allow programs to differentiate among the various types of exceptions that can occur during the execution of a program.

You can also create your own exception classes to represent problems that can occur within the classes you write. In fact, if you are a package developer, you might have to create your own set of exception classes to allow users to differentiate an error that can occur in your package from errors that occur in the Java platform or other packages.

You can also create chained exceptions. For more information, see the Chained Exceptions section.

The throw Statement

All methods use the throw statement to throw an exception. The throw statement requires a single argument: a throwable object. Throwable objects are instances of any subclass of the Throwable class. Here’s an example of a throw statement.

throw someThrowableObject;
Let’s look at the throw statement in context. The following pop method is taken from a class that implements a common stack object. The method removes the top element from the stack and returns the object.

public Object pop() {
    Object obj;

    if (size == 0) {
        throw new EmptyStackException();
    }

    obj = objectAt(size - 1);
    setObjectAt(size - 1, null);
    size--;
    return obj;
}
<pre> 

import java.io.IOException;
import java.nio.channels.FileLockInterruptionException;
public class Throwssss {
	public static void main(String[] args)throws FileLockInterruptionException,
	IOException{
		
		//FileInputStream inputStream = new FileInputStream("buka file.txt");
			System.out.println("Kode setelah buka file");
		}

	}

<pre> 

Example Throws in exception in put in a method and in calling on the exception.

import java.io.FileNotFoundException;
import java.io.IOException;


public class ThrowsException {
	public static void main(String[] args) {
		try {
		methodTidakBertanggungJawab();
		} catch(FileNotFoundException ex){
		ex.printStackTrace();
		} catch(IOException ex) {
		ex.printStackTrace();
		}
		System.out.println("kode di dalam method main");
		}
		public static void methodTidakBertanggungJawab() throws FileNotFoundException,
		IOException {
		System.out.println("kode setelah buka file");
		}

}
<pre> 

Reference :
docs.oracle
Ebook Java Desktop Ifnu Bima

(Java)Hirarki Class Exception

Exception handling is a very important yet often neglected aspect of writing robust software. When an error occurs in a Java program it usually results in an exception being thrown. How you throw, catch and handle these exception matters. There are several different ways to do so. Not all are equally efficient and fail safe.

This trail digs deeper into exception handling in Java. The trail covers various do’s and dont’s of Java exception handling. It also covers a few techniques for efficient and less error prone exception handling. Hopefully you can benefit from some of these texts.

The version of Java used in this tutorial is Java 6 and Java 7, though most of the techniques here work already from Java 5 and forward. Some even from Java 4.

Below follows a quick introduction to what you can learn in this Java exception handling trail.

Structure

try {  
//statements  
//resource-acquisition statements  
} // end try  
catch ( AKindOfException exception1 ) {  
//exception-handling statements  
} // end catch  
.  
.  
.  
catch ( AnotherKindOfException exception2 ) {  
//exception-handling statements  
} // end catch  
finally {  
//statements  
//resource-release statements  
} 
<pre> 

Example Write Here

public class Main {  
  
    public static void main(String[] args) {  
        try {  
            throwException();  
        } catch (Exception exception) {  
            System.err.println("Exception handled in main");  
        }  
        doesntThrowException();  
    }  
  
    public static void throwException() throws Exception {  
        try {  
            System.out.println("Method throwException Called");  
            throw new Exception();  
        } catch (Exception exception) {  
            System.err.println("Exception handled in method throwException");  
            throw exception;  
        } finally {  
            System.err.println("Finally executed in throwException");  
        }  
    }  
  
    public static void doesntThrowException() {  
        try {  
            System.out.println("Method doesntthrowException Called");  
        } catch (Exception exception) {  
            System.err.println(exception);  
        } finally {  
            System.err.println("Finally executed in doesntthrowException");  
        }  
        System.out.println("End of method doesNotThrowException");  
    }  
}  
<pre> 

Reference :
tutorials.jenkov.
Ebook Java Desktop Ifnu Bima