JAVA – dremi.INFO https://www.dremi.info Software Development, Digital Marketing and News Sun, 27 Mar 2011 05:30:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://www.dremi.info/wp-content/uploads/2020/12/cropped-icon-32x32.png JAVA – dremi.INFO https://www.dremi.info 32 32 Create a simple application to open an EXE file on the window with JAVA https://www.dremi.info/tutorials/java/create-a-simple-application-to-open-an-exe-file-on-the-window-with-java.html https://www.dremi.info/tutorials/java/create-a-simple-application-to-open-an-exe-file-on-the-window-with-java.html#comments Sun, 27 Mar 2011 05:30:00 +0000 https://www.dremi.info/?p=1267 […]]]> Create a simple application to open an EXE file on the window with JAVA
We will learn about how to open EXE file with JAVA. We use netbeans as IDE. So, please create new JAVA Application project. And a small form.

 

Step #1 Create few of label, combobox, and button from tool bar

I use few list item of combobox: Notepad, Window Explorer, Firefox, and Kalkulator as Target EXE

Step #2 Right click on Button to add action performed

Step #3 Use condition to select exe target

String target;
String newTarget = null;
target=(String) jComboBox1.getSelectedItem();
if(target.equals("Notepad"))
{
newTarget = "C:\\Windows\\notepad.exe";
jLabel3.setText(target + " EXECUTED!!");
}
else if(target.equals("Window Explorer"))
{
newTarget = "C:\\Windows\\explorer.exe";
jLabel3.setText(target + " EXECUTED!!");
}
else if(target.equals("Firefox"))
{
newTarget = "C:\\Program Files\\Mozilla Firefox\\firefox.exe";
jLabel3.setText(target + " EXECUTED!!");
}
else if(target.equals("Kalkulator"))
{
newTarget = "C:\\Windows\\System32\\calc.exe";
jLabel3.setText(target + " EXECUTED!!");
}
else
{
jLabel3.setText("Silahkan Pilih Salah Satu TARGET EXE");
}
try
{
Process p = Runtime.getRuntime().exec(newTarget);
p.waitFor();
System.out.println(p.exitValue());
}
catch (Exception err)
{
err.printStackTrace();
}

Step #4 Let’s RUN your application [F6]

That’s it!

]]>
https://www.dremi.info/tutorials/java/create-a-simple-application-to-open-an-exe-file-on-the-window-with-java.html/feed 5
Simple Swing Login Form And getText() https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html#comments Mon, 21 Mar 2011 17:02:20 +0000 https://www.dremi.info/?p=1260 […]]]> Simple Swing Login Form And getText()
Just say hello to my favourite IDE : NETBEANS!! At previous time, I still use PHP Designer as Main IDE, but since I worked under few of the other language such as RoR and JAVA, NETBEANS is the best IDE for me.
Well, this is my simple and short JAVA tutorial about how to create login form using SWING.

Ok, let’s open your Netbeans IDE, and chose New Java Application Project

Right click on your package of project to create new jFrame from

And then create 3 jLabel from swing control at the right panel, consist of Login title, User ID and Password

Create 1 jTextField for User ID and 1 jPasswordField for Password

The last is create a jButton into form

Right click on jButton to perform an action when button clicked

and add this code:

JOptionPane.showMessageDialog(this, "Selamat Datang" +  jTextField1.getText() + "Password Anda adalah: " +  jPasswordField1.getText(), "", JOptionPane.INFORMATION_MESSAGE);

simple isn’t it??
Now press F6 to run and build your project

]]>
https://www.dremi.info/tutorials/java/simple-swing-login-form-and-gettext.html/feed 2
Installing Apache, MySQL, PHP and JSP on Windows XP https://www.dremi.info/tutorials/java/installing-apache-mysql-php-and-jsp-on-windows-xp.html https://www.dremi.info/tutorials/java/installing-apache-mysql-php-and-jsp-on-windows-xp.html#comments Tue, 01 Sep 2009 01:57:27 +0000 https://www.dremi.info/?p=886 […]]]> You can use the following article for a guide who wants to learn PHP + JSP from scratch. Of course, before learning coding, you must install this and that. So I hope this article is useful.

Tool Requirements:

  1. Apache Server + PHP + MySQL Server
    In this case, you can make AppServ 2.5.10, you can download it at http://www.AppServNetwork.com.
    I purposely suggested using this, because to make it easy to configure, and at the same time in this installer there are Apache, PHP, and MySQL packages.
  2. J2SE
    As I explained in the previous Java Introduction, J2SE is a floating Java Edition, supports database connectivity, user interface design, input / output, and network programming and is included as the basic packages of the Java language. J2SE na you can donglod at http://java.sun.com/javase/downloads/index.jsp You can choose whichever package. The packages currently available are JDK 6 + Java EE, JDK 6 + JavaFX and JDK 6 + NetBeans 6.1.7. Everyone already has J2SE inside. But I advise you to just one bundle, not the separate ones (for example, JRE, or JDK). The problem is that someday you will definitely need it, unless your company has been installed previously.
  3. Apache TomCat
    In the future, JSP serper na, you can download it at http://tomcat.apache.org/index.html You can use the latest edition na.
  4. Apache-TomCat Connector
    Intention to connect Apache Serper and TomCat which you will install. Donglod Module na at http://tomcat.apache.org/download-connectors.cgi. Scroll down your browser, look for Tomcat Connectors JK 1.2> Binary Release, click the win32> jk-1.2.28 folder, where there are many SO module files, select nyang mod_jk-1.2.28-httpd-2.2.3.so
  5. MySQL Connector / ODBC
    This connector helps in connecting mysql database using ODBC, it can be for desktop / web based applications. Donglod connector at http://dev.mysql.com/downloads/connector/odbc/, take nyang bwat Windows 32 na.
  6. MySQL Connector JAVA / JDBC
    Konektor ini khusus digunakan oleh JAVA dalam mengakses database MySQL, baik Desktop based maupun web based. Silahkan donlod file mysql-connector-java-5.1.7-bin.jar di http://dev.mysql.com/downloads/connector/j/5.1.html

Installation stage

  1. Instalasi Apache Server + PHP + MySQL Server
    Double click appserv-win32-2.5.10.exe which you already donglod, follow the na installation instructions.



    Specify the address of the apache server drive and storage folder. In this case I make D: dreserv

    Check all the services that we will need later.
    Fill in the server name and email na
    Type in MySQL Server password na, check InnoDB if needed.
    The installation process starts …
    Run Apache and MySQL services na. Then click Finish.
    Type url> http: // localhost / in the browser, if it appears like this, it means your server is active
  2. Install J2SE, Apache TomCat + JSP
    Double click the JDK package that you already donglod, ntu ….. the logon coffee brewed: D … Follow the installation instructions.






    Instalasi sukses! Klik finish.

    To ensure that java is installed correctly, open your Windows CMD, then type java-version, if the java version gets a response, it means that java is successfully installed on your system.


    Now, when we install Apache TomCat, so we can run JSP
    Double click the apache tomcat na installation package, follow the instructions.



    Use the Full Installation option.
    Here the location of the tomcat guide is under the previous apache server folder.
    Fill in the default port, username and password. For the port, I recommend using the 8080 port.
    JRE detection, because we have previously installed the JDK with the JRE inside, the installation will automatically detect the location of the JRE path.

    Installation process …
    Check Run Apache Tomcat to immediately run Apache Tomcat na service

    A moment later. the apache tomcta service is started. and you will see there is a try icon bwar monitor apache tomcat na.

    Please open url> http: // localhost: 8080 if you open it like this, it means your Apache Tomcat installation was successful, and we can already run web applications using JSP.
  3. Configuration Apache-TomCat Connector
    • Rename the mod_jk-1.2.28-httpd-2.2.3.so file to mod_jk.so, and copy it into the D: dreservApache2.2modules folder (adjust the location of your apache server folder earlier).
    • Open file D: /dreserv/Apache2.2/conf/httpd.conf (configuration apache server) and add the following line:
    • Include "D:/dreserv/Tomcat5.5/conf/auto/mod_jk.conf"
      
    • Open file D: /dreserv/Tomcat5.5/conf/server.xml and add the following line before the line:
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
      <Listener className="org.apache.jk.config.ApacheConfig"  modJk="D:/dreserv/Apache2.2/modules/mod_jk.so" />
      
    • Create a file called workers.properties in the folder D: /dreserv/Apache2.2/conf. Type the code below and save it.
      [logger]
      level=DEBUG
      file=D:/dreserv/Apache2.2/logs/jk2.log
      [config]
      file=D:/dreserv/Apache2.2/conf/workers.properties
      debug=0
      debugEnv=0
      [shm]
      file=D:/dreserv/Apache2.2/logs/jk2.shm
      size=1048576
      # socket channel
      [channel.socket:localhost:8009]
      port=8009
      host=127.0.0.1
      # worker for the connector
      [ajp13:localhost:8009]
      channel=channel.socket:localhost:8009
      [status:status]
      [uri:/status/*]
      worker=status:status
      [uri:/jsp-examples/*]
      worker=ajp13:localhost:8009
      [uri:/*.jsp]
      worker=ajp13:localhost:8009
      
    • Restart Tomcat na by right clicking on the tomcat monitor in the try icon, then selecting stop server, and selecting again by right clicking start server.
    • Automatically, after restarting tomcat, two new directories named auto and jk will be created in the D: dreservTomcat5.5conf folder. Where there will be a mod_jk.conf file in the auto na folder.
    • Finally, restart the apacher server, by clicking Start menu> AppServ> Control Server by Services> Apache Restart
    • When testing whether the connector is working, open again http: // localhost: 8080 and http: // locahost
      If two or two na appears, congratulations apache connector with tomcat is successful. To view na report, type http: //localhost/phpinfo.php
      There you can search for mod_jk.so, now is the module active right?
  4. Instalasi MySQL Connector / ODBC
    Double click na installer package, follow instructions.



  5. Configuration MySQL Connector JAVA / JDBC
    Copy mysql-connector-java-5.1.7-bin.jar into the JRE Library folder. In this case, my JRE is in the H: / dreserv / jre6 / lib / ext folder (keep it according to your previous JDK installation folder.
    Create CLASS PATH in My Computer – System – Data Environment:
    H: /dreserv/jre6/lib/ext/mysql-connector-java-5.0.4-bin.jar;% CLASSPATH%;
    Then click OK, until the window closes. Basically, you don’t need to restart, but if you want additional work: D just restart it then: D.
  6. All installation is complete … happy working with Apache server that supports PHP, JSP and MySQL.
]]>
https://www.dremi.info/tutorials/java/installing-apache-mysql-php-and-jsp-on-windows-xp.html/feed 37
Introduction to JAVA https://www.dremi.info/articles/introduction-to-java.html https://www.dremi.info/articles/introduction-to-java.html#comments Fri, 26 Jun 2009 18:41:11 +0000 https://www.dremi.info/?p=837 […]]]> Java has evolved from being intended for applet programming in web browsers to become a programming language for the development of a variety of applications, from those running on handheld devices such as mobile phones, PDAs (Personal Digital Assistants) to large-scale (enterprise) applications on various server computers.

The most important thing is that Java is an object-oriented language for the development of standalone applications, Internet-based applications, applications for smart devices that can communicate via the Internet / communication network. With Java technology, it is possible to connect stereo audio devices to a computer network at home. Java is no longer just a topic for creating applets that beautify web pages, but Java has become a topic for large network-based enterprise application development.

A Developing Java Edition

Java is a language that can run on multiple platforms, in various environments: the internet, consumer electronic products, and computer applications. The Java 2 Platform is available in three editions for different purposes:

1. Java 2 Standard Edition (J2SE)
2. Java 2 Enterprise Edition (J2EE)
3. Java 2 Micro Edition (J2ME)

Standard Edition (J2SE)
Provides a feature-rich, stable, secure and cross-platform development environment. This edition supports database connectivity, user interface design, input / output, and network programming and is included as the basic packages of the Java language.

Enterprise Edition (J2EE)
Provides features to build and run multitier enterprise applications. J2EE contains packages in J2SE plus packages to support enterprise development JavaBeans, Java Servlets, JavaServer Pages, XML, and flexible transaction control.

Micro Edition (J2ME)
It is used for a variety of consumer electronic products, such as pagers, smart cards, cell phones, handheld PDAs, and set-top boxes. J2ME also excels in portability, anywhere scalability and safe network delivery such as J2SE and J2EE. J2ME uses a smaller package set containing only a subset of the J2SE package plus the specific Micro Edition Javax.microedition.io package. J2ME applications are scalable to work with J2SE and J2EE as well.

Java capabilities
Java has the ability to create a variety of applications today, which can consist of:

Traditional console based text based (text-based application)
Windows based or GUI Based Application for all operating system platforms
Web browser application with Java Applet
Application on a web server with Java Servlet, JSP (Java Server Pages)
Java component model-based applications such as Components in Borland Delphi or Control in Visual Basic, namely JavaBeans
The largest enterprise-scale application with EJB (Enterprise Java Beans) accompanied by database connectivity standards (JDBC-Java Database Connectivity), messaging (JMS-Java Messaging System), mailing (Java Mail), connectivity (JCA-Java Connectivity Architecture), RMI ( Remote Method Invocation) and so on
Handheld and mobile computing applications via J2ME (Java 2 Micro Edition)

Hopefully useful, thanks.

]]>
https://www.dremi.info/articles/introduction-to-java.html/feed 9