Java Appletek II. Applet GUI
|
|
- Shanon Warner
- 8 years ago
- Views:
Transcription
1 THE INTERNET,mapped on the opposite page, is a scalefree network in that Java Appletek II. dis.'~tj port,from BYALBERTU\SZLOBARABASI ANDERICBONABEAU THE INTERNET,mapped on the opposite page, is a scalefree network in that BYALBERTU\SZLOBARABASI ANDERICBONABEAU 2 Applet GUI Az appletek a böngész! ablakában jelennek meg háttér szín paraméter meghatározott méret platformok layout manager Az applet osztályok letöltése a hálózaton alosztályok
2 THE INTERNET,mapped on the opposite page, is a scalefree network in that BYALBERTU\SZLOBARABASI ANDERICBONABEAU 3 Standard out Diagnosztikai, debug üzenetek standard out, standard error System.out, System.err Appletviewer consol ablak shell ablak Célszer"en kikapcsolható kiírás THE INTERNET,mapped on the opposite page, is a scalefree network in that 4 Rendszer tulajdonságok M"ködési környezet tulajdonságai java.util.properties System.getProperty BYALBERTU\SZLOBARABASI ANDERICBONABEAU "file.separator" File separator (for example, "/") "java.class.version" Java class version number "java.vendor" Java vendorspecific string "java.vendor.url" Java vendor URL "java.version" Java version number "line.separator" Line separator "os.arch" Operating system architecture "os.name" Operating system name "path.separator" Path separator (for example, ":")
3 THE INTERNET,mapped on the opposite page, is a scalefree network in that 5 import java.awt.*; import java.awt.event.*; import javax.swing.*; Rendszer tulajdonságok (pl.) public class GetOpenProperties extends JApplet { private String[] propertynames = {"file.separator", "line.separator", "path.separator", "java.class.version", "java.vendor", "java.vendor.url", "java.version", "os.name", "os.arch", "os.version"; private final int numproperties = propertynames.length; private JLabel[] values; private javax.swing.timer timer; private int currentpropnum = 0; public void init() { ;i~e~tu"eg~ye'l"rne(;lb9.$ha redorganili //Execute ngprincipies. a job on the eventdispatching thread: //creating this applet's GUI. SwingUtilities.invokeAndWait(new Runnable() { BYALBERTU\SZLOBARABASI ANDERICBONABEAU public void run() { creategui(); ); catch (Exception e) { System.err.println("createGUI didn't successfully complete"); public void start() { //Update the GUI every 1/4 second or so. timer = new javax.swing.timer(250, new PropertyUpdater()); timer.setcoalesce(false); timer.start(); public void stop() { if (timer!= null) { timer.stop(); public void destroy() { //Execute a job on the eventdispatching thread: //destroying this applet's GUI. SwingUtilities.invokeAndWait(new Runnable() { public void run() { remove(getcontentpane()); ); catch (Exception e) { THE INTERNET,mapped on the opposite page, is a scalefree network in that 6 Rendszer tulajdonságok (pl.) private void creategui() { JPanel contentpane = new JPanel(new GridBagLayout()); GridBagConstraints labelconstraints = new GridBagConstraints(); GridBagConstraints valueconstraints = new GridBagConstraints(); labelconstraints.anchor = GridBagConstraints.WEST; labelconstraints.ipadx = 10; valueconstraints.fill = GridBagConstraints.HORIZONTAL; valueconstraints.gridwidth = GridBagConstraints.REMAINDER; valueconstraints.weightx = 1.0; //Extra space to values column. for (int i = 0; i < numproperties; i++) { names[i] = new JLabel(propertyNames[i]); names[i].setfont(propertyfont); contentpane.add(names[i], labelconstraints); values[i] = new JLabel(firstValue); values[i].setfont(valuefont); contentpane.add(values[i], valueconstraints); names[i].setlabelfor(values[i]); BYALBERTU\SZLOBARABASI ANDERICBONABEAU //Set up the Label arrays. JLabel[] names = new JLabel[numProperties]; values = new JLabel[numProperties]; String firstvalue = "<not read yet>"; //Fonts Font headingfont = new Font("SansSerif", Font.BOLD, 14); Font propertyfont = new Font("SansSerif", Font.BOLD, 12); Font valuefont = new Font("SansSerif", Font.PLAIN, 12); //Add headings. contentpane.add(createheading("property Name", headingfont), labelconstraints); contentpane.add(createheading("value", headingfont), valueconstraints); contentpane.setborder(borderfactory.createcompoundborder( BorderFactory.createLineBorder(Color.black), BorderFactory.createEmptyBorder(5,20,5,10))); setcontentpane(contentpane); private JLabel createheading(string text, Font font) { JLabel l = new JLabel(text); l.setfont(font); l.setborder(borderfactory.createcompoundborder( BorderFactory.createEmptyBorder(0,0,5,0), BorderFactory.createMatteBorder(0,0,1,0,Color.black))); return l;
4 THE INTERNET,mapped on the opposite page, is a scalefree network in that 7 Rendszer tulajdonságok (pl.) private class PropertyUpdater implements ActionListener { private String value; public void actionperformed(actionevent e) { if (currentpropnum < numproperties) { value = System.getProperty(propertyNames[currentPropNum]); if (value == null) { value = "<null value!>"; values[currentpropnum].settext(value); catch (SecurityException exc) { values[currentpropnum].settext("could not read: SECURITY EXCEPTION!"); currentpropnum++; else { timer.stop(); BYALBERTU\SZLOBARABASI ANDERICBONABEAU THE INTERNET,mapped on the opposite page, is a scalefree network in that 8 Többszálúság BYALBERTU\SZLOBARABASI ANDERICBONABEAU Id!igényes taszk végrehajtása a eseménykezelés felfüggesztése nélkül Periódikusan ismétl!d! tevékenységek végrehajtása Szerver alkalmazások
5 THE INTERNET,mapped on the opposite page, is a scalefree network in that BYALBERTU\SZLOBARABASI ANDERICBONABEAU 9 Swing és a szálak Swing komponensek általában nem támogatják a többszálon való hozzáférés (nem thread safeek) hozzáférés csak az eseménykezel! szálon komponens realizálás >eseménykezel! szál Swing komponens megrajzolása, eseménykezelés paint(), ActionPerformed() THE INTERNET,mapped on the opposite page, is a scalefree network in that 10 Swing és a szálak (folyt.) BYALBERTU\SZLOBARABASI ANDERICBONABEAU public class MyApplication { public static void main(string[] args) { JFrame f = new JFrame("Labels"); // Add components to // the frame here... f.pack(); realizálás f.show(); // Don't do any more GUI work here... biztonságos
6 THE INTERNET,mapped on the opposite page, is a scalefree network in that 11 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Swing és a szálak (folyt.) Applet GUI létrehozható az init() metódusban realizálás start()kor ne legyen id!igényes init() külön szál indítása Thread safe bárhonnan repaint(), revalidate() add...listener(), remove...listener() THE INTERNET,mapped on the opposite page, is a scalefree network in that 12 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Swing és a szálak (folyt.) Realizált GUI UIevent (AWT event) driven m"ködes GUI update igény más forrásból (nem AWT event) invokeandwait(), invokelater()
7 THE INTERNET,mapped on the opposite page, is a scalefree network in that 13 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Swing és a szálak (folyt.) Szálak Swing barát létrehozása Timer class periódikus tevékenységekhez actionperformed() metódus végrehajtása az eseménykezel! szálon THE INTERNET,mapped on the opposite page, is a scalefree network in that 14 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Többszálú appletek Az appletnek lehet több szála GUI létrehozása az eseménykezel! szálból init, start, stop, destroy nem kerül meghívásra innen Szálak használata Id!igényes inicializálás Animáció
8 THE INTERNET,mapped on the opposite page, is a scalefree network in that 15 using import like colors forjavax.swing.*; similar Webaddresses. import java.awt.*; public class PrintThread extends JApplet { Szálak példa 1. public void start() { additem("start: " + threadinfo(thread.currentthread()), false); //not on eventdispatching thread JTextArea display; public void init() { //Execute a job on the eventdispatching thread: //creating this applet's GUI. SwingUtilities.invokeAndWait(new Runnable() { public void run() { creategui(); ); catch (Exception e) { System.err.println("createGUI didn't successfully complete"); additem("init: " + threadinfo(thread.currentthread()), false); //not on eventdispatching thread private void creategui() { //Create the text area and make it uneditable. display = new JTextArea(1, 80); display.seteditable(false); BYALBERTU\SZLOBARABASI ANDERICBONABEAU //Set the layout manager so that the text area //will be as wide as possible. getcontentpane().setlayout(new GridLayout(1,0)); public void stop() { additem("stop: " + threadinfo(thread.currentthread()), false); //not on eventdispatching thread public void destroy() { additem("destroy: " + threadinfo(thread.currentthread()), false); //not on eventdispatching thread //Execute a job on the eventdispatching thread: //destroying this applet's GUI. SwingUtilities.invokeAndWait(new Runnable() { public void run() { getcontentpane().removeall(); additem("doing removeall: " + threadinfo(thread.currentthread()), true); //on eventdispatching thread ); catch (Exception e) { String threadinfo(thread t) { return "thread=" + t.getname() + ", " + "thread group=" + t.getthreadgroup().getname(); //Add the text area (in a scroll pane) to the applet. getcontentpane().add(new JScrollPane(display)); additem("creategui: " + threadinfo(thread.currentthread()), true); //on eventdispatching thread THE INTERNET,mapped on the opposite page, is a scalefree network in that 16 Szálak példa 1. (folyt.) void additem(string newword, boolean onedt) { final String s = newword + "\n"; System.out.println(newWord); if (onedt) { display.append(s); else { //Execute a job on the eventdispatching thread: //updating this applet's GUI. SwingUtilities.invokeAndWait(new Runnable() { public void run() { display.append(s); ); catch (Exception e) { BYALBERTU\SZLOBARABASI ANDERICBONABEAU
9 THE INTERNET,mapped on the opposite page, is a scalefree network in that 17 Szálak példa 2. import java.awt.*; import java.applet.applet; /* * Based on Arthur van Hoff's animation examples, this applet * can serve as a template for all animation applets. */ public class AnimatorApplet extends Applet implements Runnable { int framenumber = 1; int delay; Thread animatorthread; boolean frozen = false; public void init() { String str; int fps = 10; public void start() { if (frozen) { //Do nothing. The user has requested that we //stop changing the image. else { //Start animating! if (animatorthread == null) { animatorthread = new Thread(this); animatorthread.start(); public void stop() { //Stop the animating thread. animatorthread = null; BYALBERTU\SZLOBARABASI ANDERICBONABEAU //How many milliseconds between frames? str = getparameter("fps"); if (str!= null) { fps = Integer.parseInt(str); catch (Exception e) { delay = (fps > 0)? (1000 / fps) : 100; public boolean mousedown(event e, int x, int y) { if (frozen) { frozen = false; start(); else { frozen = true; stop(); return true; THE INTERNET,mapped on the opposite page, is a scalefree network in that 18 Szálak példa 2. (folyt.) public void run() { //Just to be nice, lower this thread's priority //so it can't interfere with other processing going on. Thread.currentThread().setPriority(Thread.MIN_PRIORITY); //Remember the starting time. long starttime = System.currentTimeMillis(); //This is the animation loop. while (Thread.currentThread() == animatorthread) { //Advance the animation frame. framenumber++; //Display it. repaint(); //Delay depending on how far we are behind. starttime += delay; Thread.sleep(Math.max(0, starttimesystem.currenttimemillis())); catch (InterruptedException e) { break; BYALBERTU\SZLOBARABASI ANDERICBONABEAU //Draw the current frame of animation. public void paint(graphics g) { g.drawstring("frame " + framenumber, 0, 30);
10 THE INTERNET,mapped on the opposite page, is a scalefree network in that 19 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Szálak példa 3. getaudioclip csak miután végzett tér vissza betöltés különszálon termel!/fogyasztó felállás SoundLoader/SoundExample SoundList THE INTERNET,mapped on the opposite page, is a scalefree network in that 20 Együttm!ködés szerveroldali alkalmzásokkal BYALBERTU\SZLOBARABASI ANDERICBONABEAU java.net csomag használható csak azzal a hoszttal, melyr!l az applet jött getcodebase().gethost() t"zfalak?
11 THE INTERNET,mapped on the opposite page, is a scalefree network in that 21 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Biztonsági korlátok megkerülése szerverrel Applet nem írhat és olvashat fájlokat a helyi fájlrendszeren adatok tárolása szerver alk. segítségével Hálózati kapcsolat csak a származási hoszttal szerver alk. építi ki a hálózati kapcsolatot más hosztokhoz Applet nem indíthat alkalmazásokat a futtató gépen szerveroldalon futhatnak alkalmazások THE INTERNET,mapped on the opposite page, is a scalefree network in that 22 BYALBERTU\SZLOBARABASI ANDERICBONABEAU A kész applet Debug konzol üzenetek kikapcsolva O# screen nem fogyaszt CPUt stop() metódus hang kikapcsolható getparameterinfo() getappletinfo()
12 THE INTERNET,mapped on the opposite page, is a scalefree network in that JNLP és Java Web Start dis.'~tj port,from BYALBERTU\SZLOBARABASI ANDERICBONABEAU THE INTERNET,mapped on the opposite page, is a scalefree network in that 24 BYALBERTU\SZLOBARABASI ANDERICBONABEAU Java Web Start Java alkalmazások elérése Web szerveren keresztül böngész! kontextuson kívüli végrehajtás végrahajtás homokozóban hozzáférési kérések kliens oldalon Java Web Start szerveroldal megfelel!en csomagolt alkalmazás Java Network Launch Protocol
13 THE INTERNET,mapped on the opposite page, is a scalefree network in that 25 Java Web Start példa import java.awt.*; import javax.swing.*; import java.io.*; import java.net.*; public class TheTime { public static void main(string args[]) { JFrame frame = new JFrame("Time Check"); frame.setdefaultcloseoperation(jframe.exit_on_close); JLabel label = new JLabel(); Container content = frame.getcontentpane(); content.add(label, BorderLayout.CENTER); String message = "missing"; BufferedReader reader = null; Socket socket = new Socket("time.nist.gov", 13); InputStream is = socket.getinputstream(); InputStreamReader isr = new InputStreamReader(is); reader = new BufferedReader(isr); reader.readline(); // skip blank line message = reader.readline(); catch (MalformedURLException e) { System.err.println("Malformed: " + e); catch (IOException e) { System.err.println("I/O Exception: " + e); finally { BYALBERTU\SZLOBARABASI ANDERICBONABEAU if (reader!= null) { reader.close(); catch (IOException ignored) { label.settext(message); frame.pack(); frame.show(); TheTime.java THE INTERNET,mapped on the opposite page, is a scalefree network in that 26 Java Web Start példa (folyt.) <?xml version="1.0" encoding="utf8"?> <jnlp spec="1.0+" codebase="file:///c:/jdc/jnlp/" > <information> <title>time Check</title> <vendor>java Developer Connection</vendor> <homepage href="/jdc" /> <description>demonstration of JNLP</description> </information> <offlineallowed/> <security> <j2eeapplicationclientpermissions/> </security> <resources> <j2se version="1.2+" /> <jar href="/developer/technicalarticles/programming/jnlp/jnlptime.jar"/> </resources> <applicationdesc mainclass="thetime" /> </jnlp> BYALBERTU\SZLOBARABASI ANDERICBONABEAU time.jnlp
14 a 27 THE INTERNET,mapped on the opposite page, is a scalefree network in that traces the shortest routes from a test Web sinho about 100,000 others, Java Web Start példa (folyt.) using like colors for similar Web addresses. s J;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies. t m a BYALBERTU\SZLO BARABASI ANDERICBONABEAU 28 THE INTERNET,mapped on the opposite page, is a scalefree network in that traces the shortest routes from a test Web sinho about 100,000 others, using like colors for similar Web addresses. s J;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies. t m BYALBERTU\SZLO BARABASI ANDERICBONABEAU Java Web Start példa (folyt.)
Advanced Network Programming Lab using Java. Angelos Stavrou
Advanced Network Programming Lab using Java Angelos Stavrou Table of Contents A simple Java Client...3 A simple Java Server...4 An advanced Java Client...5 An advanced Java Server...8 A Multi-threaded
More informationfile://c:\dokumente und Einstellungen\Marco Favorito\Desktop\ScanCmds.html
file:c:\dokumente und Einstellungen\Marco Favorito\Desktop\ScanCmds.html Seite 1 von 5 ScanCmds.java ------------------------------------------------------------------------------- ScanCmds Demontration
More informationHow To Write A Program For The Web In Java (Java)
21 Applets and Web Programming As noted in Chapter 2, although Java is a general purpose programming language that can be used to create almost any type of computer program, much of the excitement surrounding
More informationpublic class Craps extends JFrame implements ActionListener { final int WON = 0,LOST =1, CONTINUE = 2;
Lecture 15 The Game of "Craps" In the game of "craps" a player throws a pair of dice. If the sum on the faces of the pair of dice after the first toss is 7 or 11 the player wins; if the sum on the first
More informationUsing A Frame for Output
Eventos Roteiro Frames Formatting Output Event Handling Entering Data Using Fields in a Frame Creating a Data Entry Field Using a Field Reading Data in an Event Handler Handling Multiple Button Events
More informationHomework/Program #5 Solutions
Homework/Program #5 Solutions Problem #1 (20 points) Using the standard Java Scanner class. Look at http://natch3z.blogspot.com/2008/11/read-text-file-using-javautilscanner.html as an exampleof using the
More informationInformatik II. // ActionListener hinzufügen btnconvert.addactionlistener(this); super.setdefaultcloseoperation(jframe.
Universität Augsburg, Institut für Informatik Sommersemester 2006 Prof. Dr. Werner Kießling 20. Juli. 2006 M. Endres, A. Huhn, T. Preisinger Lösungsblatt 11 Aufgabe 1: Währungsrechner CurrencyConverter.java
More informationDev Articles 05/25/07 11:07:33
Java Crawling the Web with Java Contributed by McGraw Hill/Osborne 2005 06 09 Access Your PC from Anywhere Download Your Free Trial Take your office with you, wherever you go with GoToMyPC. It s the remote
More informationGraphical User Interfaces
M14_REGE1813_02_SE_C14.qxd 2/10/10 3:43 PM Page 822 Chapter14 Graphical User Interfaces 14.1 GUI Basics Graphical Input and Output with Option Panes Working with Frames Buttons, Text Fields, and Labels
More informationCS 335 Lecture 06 Java Programming GUI and Swing
CS 335 Lecture 06 Java Programming GUI and Swing Java: Basic GUI Components Swing component overview Event handling Inner classes and anonymous inner classes Examples and various components Layouts Panels
More informationINTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction
INTRODUCTION TO COMPUTER PROGRAMMING Richard Pierse Class 7: Object-Oriented Programming Introduction One of the key issues in programming is the reusability of code. Suppose that you have written a program
More informationJava Appletek I. Java és GUI-k. .'~tj;i~e~tu"eg~ye'l"rne(;lb9.$ha redorganili ngprincipies. ,fromdrugdevelopmentto Internet security
THE INTERNET,mapped on the opposite page, is a scalefree network in that Java Appletek I. dis.'~tj port,from BYALBERTU\SZLOBARABASI ANDERICBONABEAU Java és GUIk THE INTERNET,mapped on the opposite page,
More information5.17 GUI. Xiaoyi Jiang Informatik I Grundlagen der Programmierung
AWT vs. Swing AWT (Abstract Window Toolkit; Package java.awt) Benutzt Steuerelemente des darunterliegenden Betriebssystems Native Code (direkt für die Maschine geschrieben, keine VM); schnell Aussehen
More informationEssentials of the Java(TM) Programming Language, Part 1
Essentials of the Java(TM) Programming Language, Part 1 http://developer.java.sun.com/developer...ining/programming/basicjava1/index.html Training Index Essentials of the Java TM Programming Language:
More informationGUIs with Swing. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2012
GUIs with Swing Principles of Software Construction: Objects, Design, and Concurrency Jonathan Aldrich and Charlie Garrod Fall 2012 Slides copyright 2012 by Jeffrey Eppinger, Jonathan Aldrich, William
More informationAnimazione in Java. Animazione in Java. Problemi che possono nascere, e loro soluzione. Marco Ronchetti Lezione 1
Animazione in Java Problemi che possono nascere, e loro soluzione Animazione in Java Application MyFrame (JFrame) ClockPanel (JPanel) 1 public class ClockPanel extends JPanel { public ClockPanel void paintcomponent(graphics
More informationXML nyelvek és alkalmazások
THE INTERNET,mapped on the opposite page, is a scalefree network in that XML nyelvek és alkalmazások XML kezelés Javaban dis.'~tj port,from THE INTERNET,mapped on the opposite page, is a scalefree network
More informationmethod is never called because it is automatically called by the window manager. An example of overriding the paint() method in an Applet follows:
Applets - Java Programming for the Web An applet is a Java program designed to run in a Java-enabled browser or an applet viewer. In a browser, an applet is called into execution when the APPLET HTML tag
More informationHow to Convert an Application into an Applet.
How to Convert an Application into an Applet. A java application contains a main method. An applet is a java program part of a web page and runs within a browser. I am going to show you three different
More informationwww.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk
CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling
More informationProgramming with Java GUI components
Programming with Java GUI components Java includes libraries to provide multi-platform support for Graphic User Interface objects. The multi-platform aspect of this is that you can write a program on a
More informationBuilding a Multi-Threaded Web Server
Building a Multi-Threaded Web Server In this lab we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous
More information11. Applets, normal window applications, packaging and sharing your work
11. Applets, normal window applications, packaging and sharing your work In this chapter Converting Full Screen experiments into normal window applications, Packaging and sharing applications packaging
More informationCSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus
CSS 543 Program 3: Online Tic-Tac-Toe Game Professor: Munehiro Fukuda Due date: see the syllabus 1. Purpose This assignment exercises how to write a peer-to-peer communicating program using non-blocking
More informationFirst Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
More informationAn Overview of Java. overview-1
An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2
More informationEssentials of the Java Programming Language
Essentials of the Java Programming Language A Hands-On Guide by Monica Pawlan 350 East Plumeria Drive San Jose, CA 95134 USA May 2013 Part Number TBD v1.0 Sun Microsystems. Inc. All rights reserved If
More informationNetwork Traffic based Application Identification Demonstrator (Net AI) GUI. Kenny Nguyen 4150864@swin.edu.au
Network Traffic based Application Identification Demonstrator (Net AI) GUI Kenny Nguyen 4150864@swin.edu.au Supervisor: Sebastian Zander CAIA INTERNSHIP Outline Motivation Design Implementation Demonstration
More informationThe Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).
The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT) was part of the JDK form the beginning,
More informationTutorial Reference Manual. Java WireFusion 4.1
Tutorial Reference Manual Java WireFusion 4.1 Contents INTRODUCTION...1 About this Manual...2 REQUIREMENTS...3 User Requirements...3 System Requirements...3 SHORTCUTS...4 DEVELOPMENT ENVIRONMENT...5 Menu
More informationIntroduction to the Java Programming Language
Software Design Introduction to the Java Programming Language Material drawn from [JDK99,Sun96,Mitchell99,Mancoridis00] Java Features Write Once, Run Anywhere. Portability is possible because of Java virtual
More informationpublic class demo1swing extends JFrame implements ActionListener{
import java.io.*; import java.net.*; import java.io.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class demo1swing extends JFrame implements ActionListener JButton demodulacion;
More informationThe following four software tools are needed to learn to program in Java:
Getting Started In this section, we ll see Java in action. Some demo programs will highlight key features of Java. Since we re just getting started, these programs are intended only to pique your interest.
More informationChapter 2 Introduction to Java programming
Chapter 2 Introduction to Java programming 1 Keywords boolean if interface class true char else package volatile false byte final switch while throws float private case return native void protected break
More informationHow To Build A Swing Program In Java.Java.Netbeans.Netcode.Com (For Windows) (For Linux) (Java) (Javax) (Windows) (Powerpoint) (Netbeans) (Sun) (
Chapter 11. Graphical User Interfaces To this point in the text, our programs have interacted with their users to two ways: The programs in Chapters 1-5, implemented in Processing, displayed graphical
More informationCreating a Simple, Multithreaded Chat System with Java
Creating a Simple, Multithreaded Chat System with Java Introduction by George Crawford III In this edition of Objective Viewpoint, you will learn how to develop a simple chat system. The program will demonstrate
More informationThe Basic Java Applet and JApplet
I2PUJ4 - Chapter 6 - Applets, HTML, and GUI s The Basic Java Applet and JApplet Rob Dempster robd@cs.ukzn.ac.za School of Computer Science University of KwaZulu-Natal Pietermaritzburg Campus I2PUJ4 - Chapter
More informationDivision of Informatics, University of Edinburgh
CS1Bh Lecture Note 20 Client/server computing A modern computing environment consists of not just one computer, but several. When designing such an arrangement of computers it might at first seem that
More informationLösningsförslag till tentamen 121217
Uppgift 1 Lösningsförslag till tentamen 121217 a) Utskriften blir: a = 5 och b = 10 a = 5 och b = 10 b) Utskriften blir 1 2 3 4 5 5 2 3 4 1 c) Utskriften blir 321 Uppgift 2 Med användning av dialogrutor:
More informationCours de Java. Sciences-U Lyon. Java - Introduction Java - Fondamentaux Java Avancé. http://www.rzo.free.fr
Cours de Java Sciences-U Lyon Java - Introduction Java - Fondamentaux Java Avancé http://www.rzo.free.fr Pierre PARREND 1 Octobre 2004 Sommaire Java Introduction Java Fondamentaux Java Avancé GUI Graphical
More informationFiles and input/output streams
Unit 9 Files and input/output streams Summary The concept of file Writing and reading text files Operations on files Input streams: keyboard, file, internet Output streams: file, video Generalized writing
More informationHow Scala Improved Our Java
How Scala Improved Our Java Sam Reid PhET Interactive Simulations University of Colorado http://spot.colorado.edu/~reids/ PhET Interactive Simulations Provides free, open source educational science simulations
More informationOBJECT ORIENTED PROGRAMMING LANGUAGE
UNIT-6 (MULTI THREADING) Multi Threading: Java Language Classes The java.lang package contains the collection of base types (language types) that are always imported into any given compilation unit. This
More informationDuring the process of creating ColorSwitch, you will learn how to do these tasks:
GUI Building in NetBeans IDE 3.6 This short tutorial guides you through the process of creating an application called ColorSwitch. You will build a simple program that enables you to switch the color of
More informationJiST Graphical User Interface Event Viewer. Mark Fong mjf21@cornell.edu
JiST Graphical User Interface Event Viewer Mark Fong mjf21@cornell.edu Table of Contents JiST Graphical User Interface Event Viewer...1 Table of Contents...2 Introduction...3 What it does...3 Design...3
More information// Correntista. //Conta Corrente. package Banco; public class Correntista { String nome, sobrenome; int cpf;
// Correntista public class Correntista { String nome, sobrenome; int cpf; public Correntista(){ nome = "zé"; sobrenome = "Pereira"; cpf = 123456; public void setnome(string n){ nome = n; public void setsobrenome(string
More informationSwing. A Quick Tutorial on Programming Swing Applications
Swing A Quick Tutorial on Programming Swing Applications 1 MVC Model View Controller Swing is based on this design pattern It means separating the implementation of an application into layers or components:
More informationBuilding a Java chat server
Building a Java chat server Presented by developerworks, your source for great tutorials Table of Contents If you're viewing this document online, you can click any of the topics below to link directly
More informationDHBW Karlsruhe, Vorlesung Programmieren, Remote Musterlösungen
DHBW Karlsruhe, Vorlesung Programmieren, Remote Musterlösungen Aufgabe 1 RMI - TimeService public interface TimeServerInterface extends Remote { public String gettime() throws RemoteException; import java.util.date;
More informationObject Oriented Programming with Java. School of Computer Science University of KwaZulu-Natal
Object Oriented Programming with Java School of Computer Science University of KwaZulu-Natal January 30, 2006 2 Object Oriented Programming with Java Notes for the Computer Science Module Object Oriented
More informationFundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
More informationLesson: All About Sockets
All About Sockets http://java.sun.com/docs/books/tutorial/networking/sockets/index.html Page 1 sur 1 The Java TM Tutorial Start of Tutorial > Start of Trail Trail: Custom Networking Lesson: All About Sockets
More informationLogging in Java Applications
Logging in Java Applications Logging provides a way to capture information about the operation of an application. Once captured, the information can be used for many purposes, but it is particularly useful
More informationLAYOUT MANAGERS. Layout Managers Page 1. java.lang.object. java.awt.component. java.awt.container. java.awt.window. java.awt.panel
LAYOUT MANAGERS A layout manager controls how GUI components are organized within a GUI container. Each Swing container (e.g. JFrame, JDialog, JApplet and JPanel) is a subclass of java.awt.container and
More informationFachbereich Informatik und Elektrotechnik Java Applets. Programming in Java. Java Applets. Programming in Java, Helmut Dispert
Java Applets Programming in Java Java Applets Java Applets applet= app = application snippet = Anwendungsschnipsel An applet is a small program that is intended not to be run on its own, but rather to
More informationWEEK 2 DAY 14. Writing Java Applets and Java Web Start Applications
WEEK 2 DAY 14 Writing Java Applets and Java Web Start Applications The first exposure of many people to the Java programming language is in the form of applets, small and secure Java programs that run
More informationCS108, Stanford Handout #33. Sockets
CS108, Stanford Handout #33 Fall, 2007-08 Nick Parlante Sockets Sockets Sockets make network connections between machines, but you just read/write/block on them like there were plain file streams. The
More informationCSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O
CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O 1 Sending Output to a (Text) File import java.util.scanner; import java.io.*; public class TextFileOutputDemo1 public static void
More informationpublic static void main(string[] args) { System.out.println("hello, world"); } }
Java in 21 minutes hello world basic data types classes & objects program structure constructors garbage collection I/O exceptions Strings Hello world import java.io.*; public class hello { public static
More informationJava applets. SwIG Jing He
Java applets SwIG Jing He Outline What is Java? Java Applications Java Applets Java Applets Securities Summary What is Java? Java was conceived by James Gosling at Sun Microsystems Inc. in 1991 Java is
More informationAnalysis Of Source Lines Of Code(SLOC) Metric
Analysis Of Source Lines Of Code(SLOC) Metric Kaushal Bhatt 1, Vinit Tarey 2, Pushpraj Patel 3 1,2,3 Kaushal Bhatt MITS,Datana Ujjain 1 kaushalbhatt15@gmail.com 2 vinit.tarey@gmail.com 3 pushpraj.patel@yahoo.co.in
More informationCourse/Year W080/807 Expected Solution Subject: Software Development to Question No: 1
Subject: Software Development to Question No: 1 Page 1 of 2 Allocation: 33 marks (a) (i) A layout manager is an object that implements the LayoutManager interface and determines the size and position of
More informationCS 121 Intro to Programming:Java - Lecture 11 Announcements
CS 121 Intro to Programming:Java - Lecture 11 Announcements Next Owl assignment up, due Friday (it s short!) Programming assignment due next Monday morning Preregistration advice: More computing? Take
More informationCoding Standard for Java
Coding Standard for Java 1. Content 1. Content 1 2. Introduction 1 3. Naming convention for Files/Packages 1 4. Naming convention for Classes, Interfaces, Members and Variables 2 5. File Layout (.java)
More informationIntroduction to Java
Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high
More informationUsing NetBeans IDE for Desktop Development. Geertjan Wielenga http://blogs.sun.com/geertjan
Using NetBeans IDE for Desktop Development Geertjan Wielenga http://blogs.sun.com/geertjan Agenda Goals Design: Matisse GUI Builder Medium Applications: JSR-296 Tooling Large Applications: NetBeans Platform
More informationJAVA Program For Processing SMS Messages
JAVA Program For Processing SMS Messages Krishna Akkulu The paper describes the Java program implemented for the MultiModem GPRS wireless modem. The MultiModem offers standards-based quad-band GSM/GPRS
More informationBCA 421- Java. Tilak Maharashtra University. Bachelor of Computer Applications (BCA) 1. The Genesis of Java
Tilak Maharashtra University Bachelor of Computer Applications (BCA) BCA 421- Java 1. The Genesis of Java Creation of Java, Why it is important to Internet, characteristics of Java 2. Basics of Programming
More informationSzervletek. ANTAL Margit. Sapientia - EMTE, Pannon Forrás,,Egységes erdélyi felnőttképzés a
Sapientia - EMTE, Pannon Forrás,,Egységes erdélyi felnőttképzés a Kárpát-medencei hálózatban 2010 HTTP kérés-válasz modell A Servlet API közötti kommunikáció Megjelenítési komponens Vezérlési komponens
More informationhttp://netbeans.org/kb/docs/java/gui-functionality.html?print=yes
Page 1 of 6 Introduction to GUI Building Contributed by Saleem Gul and Tomas Pavek, maintained by Ruth Kusterer and Irina Filippova This beginner tutorial teaches you how to create a simple graphical user
More informationTutorial: Getting Started
9 Tutorial: Getting Started INFRASTRUCTURE A MAKEFILE PLAIN HELLO WORLD APERIODIC HELLO WORLD PERIODIC HELLO WORLD WATCH THOSE REAL-TIME PRIORITIES THEY ARE SERIOUS SUMMARY Getting started with a new platform
More informationB.Sc (Honours) - Software Development
Galway-Mayo Institute of Technology B.Sc (Honours) - Software Development E-Commerce Development Technologies II Lab Session Using the Java URLConnection Class The purpose of this lab session is to: (i)
More informationSocket-based Network Communication in J2SE and J2ME
Socket-based Network Communication in J2SE and J2ME 1 C/C++ BSD Sockets in POSIX POSIX functions allow to access network connection in the same way as regular files: There are special functions for opening
More informationKonzepte objektorientierter Programmierung
Konzepte objektorientierter Programmierung Prof. Dr. Peter Müller Werner Dietl Software Component Technology Exercises 5: Frameworks Wintersemester 05/06 2 Homework 1 Observer Pattern From: Gamma, Helm,
More informationJava SE 6 Update 10. la piattaforma Java per le RIA. Corrado De Bari. Sun Microsystems Italia Spa. Software & Java Ambassador
Java SE 6 Update 10 & JavaFX: la piattaforma Java per le RIA Corrado De Bari Software & Java Ambassador Sun Microsystems Italia Spa 1 Agenda What's news in Java Runtime Environment JavaFX Technology Key
More informationJava Interview Questions and Answers
1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java
More informationFondamenti di Java. Introduzione alla costruzione di GUI (graphic user interface)
Fondamenti di Java Introduzione alla costruzione di GUI (graphic user interface) component - container - layout Un Container contiene [0 o +] Components Il Layout specifica come i Components sono disposti
More informationSE 450 Object-Oriented Software Development. Requirements. Topics. Textbooks. Prerequisite: CSC 416
SE 450 Object-Oriented Software Development Instructor: Dr. Xiaoping Jia Office: CST 843 Tel: (312) 362-6251 Fax: (312) 362-6116 E-mail: jia@cs.depaul.edu URL: http://se.cs.depaul.edu/se450/se450.html
More information13 File Output and Input
SCIENTIFIC PROGRAMMING -1 13 File Output and Input 13.1 Introduction To make programs really useful we have to be able to input and output data in large machinereadable amounts, in particular we have to
More informationContinuous Integration Part 2
1 Continuous Integration Part 2 This blog post is a follow up to my blog post Continuous Integration (CI), in which I described how to execute test cases in Code Tester (CT) in a CI environment. What I
More informationCISC 4700 L01 Network & Client- Server Programming Spring 2016. Harold, Chapter 8: Sockets for Clients
CISC 4700 L01 Network & Client- Server Programming Spring 2016 Harold, Chapter 8: Sockets for Clients Datagram: Internet data packet Header: accounting info (e.g., address, port of source and dest) Payload:
More informationLearning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP
CP4044 Lecture 7 1 Networking Learning Outcomes To understand basic network terminology To be able to communicate using Telnet To be aware of some common network services To be able to implement client
More informationExtending Desktop Applications to the Web
Extending Desktop Applications to the Web Arno Puder San Francisco State University Computer Science Department 1600 Holloway Avenue San Francisco, CA 94132 arno@sfsu.edu Abstract. Web applications have
More informationSchueler-Organisiertes Lernen am Beispiel von Grafischen Benutzer-Schnittstellen in Java Tag der Offenen Tür - GTS 2008
Schueler-Organisiertes Lernen am Beispiel von Grafischen Benutzer-Schnittstellen in Java Tag der Offenen Tür - GTS 2008 http://worgtsone.scienceontheweb.net/worgtsone/ - mailto: worgtsone @ hush.com Sa
More informationProf. Edwar Saliba Júnior
package Conexao; 2 3 /** 4 * 5 * @author Cynthia Lopes 6 * @author Edwar Saliba Júnior 7 */ 8 import java.io.filenotfoundexception; 9 import java.io.ioexception; 10 import java.sql.sqlexception; 11 import
More informationHow To Program In Java (Ipt) With A Bean And An Animated Object In A Powerpoint (For A Powerbook)
Graphic Interface Programming II Applets and Beans and animation in Java IT Uppsala universitet Applets Small programs embedded in web pages
More informationIntroduction to Java. Module 12: Networking (Java Sockets) Prepared by Costantinos Costa for EPL 233. ΕΠΛ233 Αντικειμενοστρεφής Προγραμματισμός 1
Introduction to Java Module 12: Networking (Java Sockets) Prepared by Costantinos Costa for EPL 233 ΕΠΛ233 Αντικειμενοστρεφής Προγραμματισμός 1 What Is a Socket? A socket is one end-point of a two-way
More informationSummer Internship 2013
Summer Internship 2013 Group IV - Enhancement of Jmeter Week 4 Report 1 9 th June 2013 Shekhar Saurav Report on Configuration Element Plugin 'SMTP Defaults' Configuration Elements or config elements are
More informationChulalongkorn University International School of Engineering Department of Computer Engineering 2140105 Computer Programming Lab.
Chulalongkorn University Name International School of Engineering Student ID Department of Computer Engineering Station No. 2140105 Computer Programming Lab. Date Lab 2 Using Java API documents, command
More informationJIDE Action Framework Developer Guide
JIDE Action Framework Developer Guide Contents PURPOSE OF THIS DOCUMENT... 1 WHAT IS JIDE ACTION FRAMEWORK... 1 PACKAGES... 3 MIGRATING FROM EXISTING APPLICATIONS... 3 DOCKABLEBARMANAGER... 9 DOCKABLE
More informationHere's the code for our first Applet which will display 'I love Java' as a message in a Web page
Create a Java Applet Those of you who purchased my latest book, Learn to Program with Java, know that in the book, we create a Java program designed to calculate grades for the English, Math and Science
More informationTranslating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language
Translation Translating to Java Introduction to Computer Programming The job of a programmer is to translate a problem description into a computer language. You need to be able to convert a problem description
More informationFinal Project Report E3390 Electronic Circuit Design Lab. Electronic Notepad
Final Project Report E3390 Electronic Circuit Design Lab Electronic Notepad Keith Dronson Sam Subbarao Submitted in partial fulfillment of the requirements for the Bachelor of Science Degree May 10, 2008
More informationThe Java I/O System. Binary I/O streams (ascii, 8 bits) The decorator design pattern Character I/O streams (Unicode, 16 bits)
Binary I/O streams (ascii, 8 bits) InputStream OutputStream The Java I/O System The decorator design pattern Character I/O streams (Unicode, 16 bits) Reader Writer Comparing Binary I/O to Character I/O
More informationAssignment No.3. /*-- Program for addition of two numbers using C++ --*/
Assignment No.3 /*-- Program for addition of two numbers using C++ --*/ #include class add private: int a,b,c; public: void getdata() couta; cout
More information@ - Internal # - External @- Online TH PR OR TW TOTAL HOURS 04 --- 04 03 100 50# --- 25@ 175
COURSE NAME : COMPUTER ENGINEERING GROUP COURSE CODE SEMESTER SUBJECT TITLE : CO/CM/IF/CD : SIXTH : ADVANCED JAVA PROGRAMMING SUBJECT CODE : Teaching and Examination Scheme: @ - Internal # - External @-
More informationSection 6 Spring 2013
Print Your Name You may use one page of hand written notes (both sides) and a dictionary. No i-phones, calculators or any other type of non-organic computer. Do not take this exam if you are sick. Once
More informationComputing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
More informationJava is commonly used for deploying applications across a network. Compiled Java code
Module 5 Introduction to Java/Swing Java is commonly used for deploying applications across a network. Compiled Java code may be distributed to different machine architectures, and a native-code interpreter
More informationCapabilities of a Java Test Execution Framework by Erick Griffin
Capabilities of a Java Test Execution Framework by Erick Griffin Here we discuss key properties and capabilities of a Java Test Execution Framework for writing and executing discrete Java tests for testing
More information