• No results found

Java Appletek II. Applet GUI

N/A
N/A
Protected

Academic year: 2021

Share "Java Appletek II. Applet GUI"

Copied!
14
0
0

Loading.... (view fulltext now)

Full text

(1)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

Java Appletek II.

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

2

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

3

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

4

Webtechnológia 1

Rendszer

tulajdonságok

• M"ködési környezet tulajdonságai

• java.util.Properties

• System.getProperty

"file.separator" File separator (for example, "/")

"java.class.version" Java class version number

"java.vendor" Java vendor-specific string

"java.vendor.url" Java vendor URL

"java.version" Java version number

"line.separator" Line separator

"os.arch" Operating system architecture

(3)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

5

Webtechnológia 1

Rendszer

tulajdonságok (pl.)

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

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() {

//Execute a job on the event-dispatching thread:

//creating this applet's GUI.

try {

SwingUtilities.invokeAndWait(new Runnable() {

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 event-dispatching thread:

//destroying this applet's GUI.

try {

SwingUtilities.invokeAndWait(new Runnable() {

public void run() {

remove(getContentPane());

}

});

} catch (Exception e) { }

}

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

6

Webtechnológia 1

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.

//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);

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]);

}

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

7

Webtechnológia 1

Rendszer

tulajdonságok (pl.)

private class PropertyUpdater implements ActionListener {

private String value;

public void actionPerformed(ActionEvent e) {

if (currentPropNum < numProperties) {

try {

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();

}

}

}

}

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

8

Webtechnológia 1

Többszálúság

• 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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

9

Webtechnológia 1

Swing és a szálak

• Swing komponensek általában nem

támogatják a többszálon való

hozzáférés (nem thread safe-ek)

• 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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

10

Webtechnológia 1

Swing és a szálak

(folyt.)

public class MyApplication {

public static void main(String[] args) {

JFrame f = new JFrame("Labels");

// Add components to

// the frame here...

f.pack();

f.show();

// Don't do any more GUI work here...

}

}

realizálás

biztonságos

(6)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

11

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

12

Webtechnológia 1

Swing és a szálak

(folyt.)

• Realizált GUI

• UI-event (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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

13

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

14

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

15

Webtechnológia 1

Szálak példa 1.

import javax.swing.*;

import java.awt.*;

public class PrintThread extends JApplet {

JTextArea display;

public void init() {

//Execute a job on the event-dispatching thread:

//creating this applet's GUI.

try {

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 event-dispatching thread

}

private void createGUI() {

//Create the text area and make it uneditable.

display = new JTextArea(1, 80);

display.setEditable(false);

//Set the layout manager so that the text area

//will be as wide as possible.

getContentPane().setLayout(new GridLayout(1,0));

//Add the text area (in a scroll pane) to the applet.

getContentPane().add(new JScrollPane(display));

addItem("createGUI: " + threadInfo(Thread.currentThread()),

true); //on event-dispatching thread

}

public void start() {

addItem("start: " + threadInfo(Thread.currentThread()),

false); //not on event-dispatching thread

}

public void stop() {

addItem("stop: " + threadInfo(Thread.currentThread()),

false); //not on event-dispatching thread

}

public void destroy() {

addItem("destroy: " + threadInfo(Thread.currentThread()),

false); //not on event-dispatching thread

//Execute a job on the event-dispatching thread:

//destroying this applet's GUI.

try {

SwingUtilities.invokeAndWait(new Runnable() {

public void run() {

getContentPane().removeAll();

addItem("doing removeAll: "

+ threadInfo(Thread.currentThread()),

true); //on event-dispatching thread

}

});

} catch (Exception e) { }

}

String threadInfo(Thread t) {

return "thread=" + t.getName() + ", "

+ "thread group=" + t.getThreadGroup().getName();

}

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

16

Webtechnológia 1

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 event-dispatching thread:

//updating this applet's GUI.

try {

SwingUtilities.invokeAndWait(new Runnable() {

public void run() {

display.append(s);

}

});

} catch (Exception e) { }

}

}

}

(9)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

17

Webtechnológia 1

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;

//How many milliseconds between frames?

str = getParameter("fps");

try {

if (str != null) {

fps = Integer.parseInt(str);

}

} catch (Exception e) {}

delay = (fps > 0) ? (1000 / fps) : 100;

}

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;

}

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

18

Webtechnológia 1

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.

try {

startTime += delay;

Thread.sleep(Math.max(0,

startTime-System.currentTimeMillis()));

} catch (InterruptedException e) {

break;

}

}

}

//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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

19

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

20

Webtechnológia 1

Együttm!ködés szerver-

oldali alkalmzásokkal

• 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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

21

Webtechnológia 1

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 scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

22

Webtechnológia 1

A kész applet

• Debug konzol üzenetek kikapcsolva

• O# screen nem fogyaszt CPU-t

• stop() metódus

• hang kikapcsolható

• getParameterInfo()

• getAppletInfo()

(12)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

JNLP és

Java Web Start

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

24

Webtechnológia 1

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

(13)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

25

Webtechnológia 1

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;

try {

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 {

if (reader != null) {

try {

reader.close();

} catch (IOException ignored) {

}

}

}

label.setText(message);

frame.pack();

frame.show();

}

}

TheTime.java

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

26

Webtechnológia 1

Java Web Start

példa (folyt.)

<?xml version="1.0" encoding="UTF-8"?>

<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>

<offline-allowed/>

<security>

<j2ee-application-client-permissions/>

</security>

<resources>

<j2se version="1.2+" />

<jar href="/developer/technicalArticles/Programming/jnlp/JNLPTime.jar"/>

</resources>

<application-desc main-class="TheTime" />

</jnlp>

time.jnlp

(14)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

BYALBERT-U\SZLO BARABASI ANDERICBONABEAU

50 SCIENTIFIC AMERICAN MAY 2003

27

Webtechnológia 1

Java Web Start

példa (folyt.)

THE INTERNET,mapped on the opposite page, is a scale-free network in that some siteS(starbursts and detail above)have a seemingly unlimited number of connections to other sites. This map, made on February 6, 2003, traces the shortest routes from a test Web sinHo about100,000others, using like colors for similar Web addresses.

a -

Scientistshave recently discoveredthat variouscomplexsystemshave

antlnderlyihg~..'~tJ;i~e~tu"eg~Ye'l"rne(;lb9.$ha red organili ng principies.

Thisinsighthas important impli~ationsfor a hostof

applications,from drugdevelopmentto Internet security

28

Webtechnológia 1

Java Web Start

példa (folyt.)

References

Related documents

[r]

Through its Education and Leadership Development Program, the Jackie Robinson Foundation provides scholarships of up to $24,000/four years to minority high school students

Initial Cost Projections

(2004) Comparison of MPEG-7 audio spectrum projection features and MFCC applied to speaker recognition, sound classification and audio segmentation, In : Proceedings of the

When a new view is granted to user U, the model uses inference control algorithm to infer relationships of the relation R which user U can access by the new view.. The model uses

Abstract: Inspired by the narrative nature of Landscape Character Assessment (LCA), we present a complete workflow to (i) build a collection of almost 7000 online texts

Determine which encryption cipher is used for the database on the Android, BlackBerry and iPhone operating system in the first week of the project?. 2.3.2 How strong is

April 2003 KCB Management Centre, Karen, Paper presented – Building a culture of Peace through Reconciliation from an African Traditional Religion’s Perspective.. 