Programming For Artists - PowerPoint PPT Presentation

1 / 67
About This Presentation
Title:

Programming For Artists

Description:

Have you all handed in the brief and also put. a link to it on ... you can add scrolls to them so the user can scroll up and down through large amounts of text. ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 68
Provided by: dare
Category:

less

Transcript and Presenter's Notes

Title: Programming For Artists


1
MFA Computational Studio Arts
Programming For Artists Term 2
GUIs ctd Threads
2
Have you all handed in the brief and also put a
link to it on your personal pfa website?
3
Java colours by name
i.e g.setColor(Color.red) same as
g.setColor(new Color(255, 0, 0)) Same as
fill(255, 0, 0) or Stroke(255, 0, 0 ) in
Processing
4
What Does "Pluggable Look and Feel" Mean? Swing
is a part of the Java Foundation Classes (JFC)
and implements a set of graphical user interface
(GUI) components with a pluggable look and feel
(LF). In very short terms, this means that
Swing-based applications can appear as if they
are native Windows, Mac OS X, GTK, or Motif
applications, or they can have a unique Java look
and feel through the "Metal" package.
http//today.java.net/pub/a/today/2004/02/27/laf.h
tml
5
Changing what Java calls the Look and Feelof
interfaces, see this site http//java.sun.com/doc
s/books/tutorial/uiswing/lookandfeel/plaf.html
6
(No Transcript)
7
GUIs continued, Threads
8
JSliders JText components JComboBox JColorChooser
9
PaintTicks lines PaintLabels numbers
JSlider
10
The ChangeListeners Listens for any changes to
JSliders, those changes are passed into a Color
Variable called current using the
JSliders getValue() method, there are 3
JSliders for R, G and B values
11
import javax.swing.import javax.swing.event.im
port java.awt. public class ColorSlide extends
JFrame implements ChangeListener ColorPanel
canvas new ColorPanel() JSlider red new
JSlider(0, 255, 255)//0, 255 range, 255
initial value , //here it is full
red JSlider green new JSlider(0, 255, 0)
JSlider blue new JSlider(0, 255, 0)
public ColorSlide() super("Color
Slide") setSize(270, 300)
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
setVisible(true)
red.setMajorTickSpacing(50)
red.setMinorTickSpacing(10)
red.setPaintTicks(true)
red.setPaintLabels(true)
red.addChangeListener(this)
green.setMajorTickSpacing(50)
green.setMinorTickSpacing(10)
green.setPaintTicks(true)
green.setPaintLabels(true)
green.addChangeListener(this)
blue.setMajorTickSpacing(50)
blue.setMinorTickSpacing(10)
blue.setPaintTicks(true)
blue.setPaintLabels(true)
blue.addChangeListener(this)
12
JLabel redLabel new JLabel("Red ")
JLabel greenLabel new JLabel("Green ")
JLabel blueLabel new JLabel("Blue ")
GridLayout grid new GridLayout(4, 1) //4
rows high, 1 column wide FlowLayout right
new FlowLayout(FlowLayout.RIGHT)
Container pane getContentPane()
pane.setLayout(grid) JPanel redPanel
new JPanel() redPanel.setLayout(right)
redPanel.add(redLabel)
redPanel.add(red) pane.add(redPanel)
JPanel greenPanel new JPanel()
greenPanel.setLayout(right)
greenPanel.add(greenLabel)
greenPanel.add(green) pane.add(greenPanel
) JPanel bluePanel new JPanel()
bluePanel.setLayout(right)
bluePanel.add(blueLabel)
bluePanel.add(blue) pane.add(bluePanel)
pane.add(canvas)
setContentPane(pane)
A common scenario different layouts for
different Components so it all fits together
this order means that the labels are to the left
of the sliders Experiment with a different
order to see how it works, as it isnt
too Intuitive
13
public void stateChanged(ChangeEvent evt)
JSlider source (JSlider)evt.getSource()
if (source.getValueIsAdjusting() ! true)
//wait for slider to stop, can also be dynamic
Color current new Color(red.getValue(),
green.getValue(), blue.getValue()) //here we
get new color //values from slider
throughgetValue() method for R, G and B
canvas.changeColor(current) //canvas is an
instance of the ColorPanel class below //it calls
its changeColor() method using current as an
argument canvas.repaint() //refresh
paintComponent() by invoking repaint() method
public static void
main(String arguments) ColorSlide cs
new ColorSlide() class ColorPanel
extends JPanel Color background
ColorPanel() background Color.red
//initial value public void
paintComponent(Graphics comp)
Graphics2D comp2D (Graphics2D)comp
comp2D.setColor(background)
comp2D.fillRect(0, 0, getSize().width,
getSize().height) void
changeColor(Color newBackground)
background newBackground
From Java in East Steps Mike McGrath,
14
49 panels in a JFrame
7 deep 7 wide, 2, 2 creates space between
each Row, the black background is peeping
through that space
49 Fits evenly into a 7 by 7 grid, but you can
try different parameters
Math.random() 16777215)) - a way of accessing
the 16 million possible colours available Look
up the Java Color class There are a lot of
overloadable Color methods
15
Variation on previous code with a JColourChooser
16
import javax.swing.JFrame import
java.awt.GridLayout public class MainFrame
extends JFrame public MainFrame()
super("Nine Squares") this.setSize(400, 400)
getContentPane().setLayout(new
GridLayout(3,3)) for (int i 0 ilt9 i)
getContentPane().add(new EachSquare())
setVisible(true) setDefaultCloseOperation(EXIT_
ON_CLOSE) public static void
main(String arguments) MainFrame cs
new MainFrame()
Consists of 2 classes See over for other class
17
import javax.swing.JPanel import
java.awt.Color import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent import
javax.swing.JColorChooser public class
EachSquare extends JPanel public EachSquare()
setBackground(new Color((int)(Math.random()
16777215)) ) addMouseListener(new
MouseClickListener()) public class
MouseClickListener extends MouseAdapter
public void mouseClicked(MouseEvent e)
setBackground(JColorChooser.showDialog(
EachSquare.this, "Choose Background Color",
getBackground()))
18
(No Transcript)
19
JComboBox
20
import javax.swing. import java.awt. import
java.awt.event. class SwingWindow extends
JFrame JComboBox islands String str
public SwingWindow() super("Combo
Box") setSize(300, 100) setDefaultCloseOpera
tion(JFrame.EXIT_ON_CLOSE) setVisible(true)
Container contentArea getContentPane()
FlowLayout flowManager new FlowLayout() con
tentArea.setLayout(flowManager) islands
new JComboBox() islands.addItem("Corfu") i
slands.addItem("Kefalonia") islands.addItem("Cr
ete") islands.addItem("Rhodes") islands.addI
tem("Paxos") islands.addItem("Mykonos")
21
islands.addItemListener(new ItemListener()
public void itemStateChanged(ItemEvent
ie) //solution to java's double firing bug!
EDARE Jan 2009 if(ie.getStateChange()
ItemEvent.SELECTED) // solution
String str (String)islands.getSelectedItem()
//and this System.out.println(str)
if(str.equals("Paxos"))
System.out.println(" BINGO! ")
) contentArea.add(islands)
setContentPane(contentArea)
public class ComboBoxG
public static void main(String
args) SwingWindow ComboBox new
SwingWindow()
22
Bizarre combination now choosing Paxos
stops The Penguin, and Corfu starts him again!
Should change to more sensible labels here
23
import java.awt. import java.awt.event. impo
rt javax.swing. public class combo_Wave
extends JApplet implements Runnable//,
ActionListener Thread runner JButton
play JButton stop JComboBox islands
String str Image pic new Image11 int
total 0 int count 0 public void init()
this.setSize(400, 150) for(int
i1 ilt10 i) pici
getImage(getDocumentBase(),i".gif")
total //continued on next slides
24
Container contentArea getContentPane()
GridLayout grid new GridLayout(1,2) //try 1,1
contentArea.setLayout(grid)
contentArea.setBackground(Color.white)
JPanel console new JPanel() FlowLayout
flow new FlowLayout() console.setLayout(flo
w) console.setBackground(Color.white)
JugglerPanel animation new JugglerPanel()
islands new JComboBox() islands.addItem("Co
rfu") islands.addItem("Kefalonia")
islands.addItem("Crete") islands.addItem("Rho
des") islands.addItem("Paxos")
islands.addItem("Mykonos")
islands.addItemListener(new ItemListener()
public void itemStateChanged(ItemEvent ie)
//solution to java's double firing bug! EDARE
Jan 2009 if(ie.getStateChange()
ItemEvent.SELECTED) // solution String
str (String)islands.getSelectedItem() //and
this System.out.println(str)
if(str.equals("Paxos"))
System.out.println(" BINGO! ")
stop()
if(str.equals("Corfu"))
System.out.println(" BINGO! ")
start()
)
25
console.add(islands) contentArea.add(animatio
n) //jugglerPanel object contentArea.add(cons
ole) //add the JPanle to the contentArea
setContentPane(contentArea) / The
JugglerPanel class provides an area in
the applet interface on which to display
an animated sequence of GIF images. /
class JugglerPanel extends JPanel public
void paintComponent(Graphics painter)
if( piccount ! null )
painter.drawImage( piccount, 20, 0, 43,
71,this) painter.setColor(Color.red)
int num (int)(Math.random() 42)
painter.fillOval(num, 1, 5, 5)
public void start() if(runner null)
runner new Thread(this)
runner.start() public void run()
while (runner Thread.currentThread() )
repaint() count
if(count gt total) count0 try
Thread.sleep(30)
catch(InterruptedException e)
public void stop() if(runner !
null) runner null //end
26
JSlider
Gets its diameter value from The getValue()
method of JSlider. Program has two classes, see
over
Slider demo from Deital and Deital, Java how
to Program a huge book on Java
27
import java.awt. import javax.swing. public
class OvalPanel extends JPanel private int
diameter 10 public void paintComponent(
Graphics g ) super.paintComponent( g
) g.fillOval( 10, 10, diameter, diameter
) public void setDiameter( int d )
diameter ( d gt 0 ? d 10 ) //
default diameter 10 repaint() //
the following methods are used by layout
managers public Dimension getPreferredSize()
return new Dimension( 200, 200 )
public Dimension getMinimumSize()
return getPreferredSize() //see over
28
import java.awt. import java.awt.event.
import javax.swing. import javax.swing.event.
public class SliderDemo extends JFrame
private JSlider diameter private OvalPanel
myPanel public SliderDemo()
super( "Slider Demo" ) myPanel new
OvalPanel() myPanel.setBackground(
Color.yellow ) diameter new JSlider(0,
200, 10 ) diameter.setMajorTickSpacing( 10
) diameter.setPaintTicks( true )
diameter.addChangeListener( new
ChangeListener() public void
stateChanged( ChangeEvent e )
myPanel.setDiameter( diameter.getValue()
) //call myPanels setDiameter() method,
myPanel is an instance of OvalPanel
//end of anonymous inner class
) //end call to change listener
Ooh this is an anonymous Inner class, its the
most likely Occurrence of one in a Situation
for handling Events, inner classes have more
access to the fields and Methods of its enclosing
class than sub classes, including private
fields And methods, it has access to the current
instance of a class,so it Can get at instance
data, they are usually doing things only the
enclosing Class needs access to, so usually they
are private. The anonymous class here as you
would expect perhaps.. Hasnt got a name, hence
no constructor, ChangeListener() is referenced
instead of a name, indicating the type of Object
created form this class, its being used here as
a listener for the slider
29
Container c getContentPane()
c.add( diameter, BorderLayout.SOUTH )
c.add( myPanel, BorderLayout.CENTER )
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
setSize( 220, 270 ) setVisible(true)
public static void main( String args )
SliderDemo app new SliderDemo()

30
(No Transcript)
31
JTextField
A JTextField is an area users can type into. This
example uses a JOptionPane to respond
32
import javax.swing.import java.awt.event.p
ublic class Namer extends JFrame public static
void main(String args) new
Namer() private JButton buttonOK private
JTextField textName public Namer()
this.setSize(325,100) this.setTitle("Who
Are You?") this.setDefaultCloseOperation(JFr
ame.EXIT_ON_CLOSE) ButtonListener bl new
ButtonListener() JPanel panel1 new
JPanel() panel1.add(new JLabel("Enter
your name "))
textName new JTextField(15)
panel1.add(textName) buttonOK new
JButton("OK") buttonOK.addActionListener(bl)
panel1.add(buttonOK)
this.add(panel1) this.setVisible(true)
//see over
33
private class ButtonListener implements
ActionListener public void actionPerformed(Act
ionEvent e)if (e.getSource()
buttonOK) String name textName.getText()
if (name.length() 0) JOptionPane.showMessa
geDialog(Namer.this, "You didn't enter
anything!")else JOptionPane.showMessage
Dialog(Namer.this, "Salutations "
textName.getText()) textName.requestFocus()

34
There are other types of Text components such as
JTextArea, you can add scrolls to them so the
user can scroll up and down through large amounts
of text. This is the best source of
information http//java.sun.com/docs/books/tutori
al/uiswing/components/text.html
35
You can download this demo
36
A custom JButton using my own ImageIcon
37
Most of the examples today used Layout
Managers For more details go to the Java
tutorial http//java.sun.com/docs/books/tutorial
/uiswing/layout/layoutlist.html
38
Threads.
Every program we have written so far has used a
thread the main thread automatically starts
when we run a program. Java also allows Us to
create our own threads to perform specific tasks.
Threads allow programs to do different tasks at
the same time, You might see this referred to
as multi-threading. The draw() method In
Processing can animate things because It runs on
a loop this loop is a thread
39
Thread is part of the Java.lang package of
classes this is automatically available so you
do not need to write a header (import
statement). However, to control the performance
of a thread you have to use the
runnable Interface, you do this by writing
implements Runnable in your class Declaration.
You can do it another way, which may seem
confusing but as they say TIAMTOWODT The
other way is to write extends Thread in your
class declaration, this gives you access to those
runnable methods that control a thread, such as
start() Here is one of the simplest possible
examples of creating a thread in Java
40
public class CountDownClock extends
Thread public static void main(String
args) Thread clock new CountDownClock() clock
.start() //call start() method of Thread class
//the thread wont start without this call
public void run() // the run() method defines
the tasks that a thread will perform for (int
t 20 t gt 0 t--) System.out.println("T
minus " t) try Thread.sleep(1000) catch
(InterruptedException e)
In between printing the countdown The thread will
sleep for a second, Like delay() In Processing,
but it will Stop when the loop has finished
This is a try-catch block, Things can go wrong
with a Thread this block will catch the
exception A strange way of saying it
will Realise something is wrong and Take action.
The compiler wont like it if you Forget to do
this. The run() Method has to call sleep() or
yield() At some point, to allow for other threads
41
There is no longer a built in stop() method for
threads this has been deprecated (a bit like
being retired), Instead you should really start
your thread with a Null comparison, like
this Public void start() If(runner null)
runner new Thread(this) runner.start() That
way you can create your own cheeky and
perfectly safe stop method like this Public
void stop() If(runner ! null) runner
null PsYou can call your thread tom, dick or
harry, as well as runner
42
import java.awt. import javax.swing. import
java.util. class Clock extends JFrame
implements Runnable Thread runner Font
clockFont public Clock() super("Java
Clock") setSize(300, 80) setDefaultCloseOpera
tion(JFrame.EXIT_ON_CLOSE) setVisible(true) cloc
kFont new Font("Serif", Font.BOLD,
40) Container contentArea getContentPane() Cl
ockPanel timeDisplay new ClockPanel() contentAr
ea.add(timeDisplay) setContentPane(contentArea)

43
start() class ClockPanel extends
JPanel public void paintComponent(Graphics
painter) painter.setColor(Color.white)
painter.fillRect( 0,0,getSize().width,
getSize().height ) painter.setFont(clockFont)
painter.setColor(Color.red) painter.drawString(
timeNow(), 60, 40)
44
public String timeNow() Calendar now
Calendar.getInstance() int hrs
now.get(Calendar.HOUR_OF_DAY) int min
now.get(Calendar.MINUTE) int sec
now.get(Calendar.SECOND) String current
zero(hrs)""zero(min)""zero(sec) return
current public String zero(int num)
String number(numlt10) ? ("0"num) (""num)
return number public void
start() if(runner null) runner new
Thread(this) runner.start()
45
public void run() while (runner
Thread.currentThread() ) repaint() try
Thread.sleep(1000) catch(InterruptedExcept
ion e) public void
stop() if(runner ! null) runner
null public static void main(String
args) Clock eg new Clock()
46
(No Transcript)
47
import java.awt. import java.awt.event. import
javax.swing. public class Animation extends
JApplet implements Runnable, ActionListener
Thread runner JButton play JButton stop
Image pic new Image5 int total
0 int count 0 public void init()
for(int i0 ilt5 i) pici
getImage(getClass().getResource("image"i".gif"))
total Container contentArea
getContentPane()
GridLayout grid new GridLayout(1,2) content
Area.setLayout(grid) contentArea.setBackg
round(Color.white)
48
JPanel console new JPanel()
FlowLayout flow new FlowLayout() console.se
tLayout(flow) console.setBackground(Color.whi
te) AnimPanel animation new
AnimPanel() Image signImage
getImage(getClass().getResource("sign.gif")) Imag
eIcon signIcon new ImageIcon(signImage) JLabel
sign new JLabel(signIcon) Image playImage
getImage(getClass().getResource("accept.gif"))
ImageIcon playIcon new ImageIcon(playImage) pla
y new JButton("Click To Start",playIcon) pl
ay.addActionListener(this) Image stopImage
getImage(getClass().getResource("cancel.gif")) Im
ageIcon stopIcon new ImageIcon(stopImage) stop
new JButton("Click To Stop",stopIcon)
49
stop.addActionListener(this)cons
ole.add(sign)console.add(play)console.add(stop
) contentArea.add(animation)
contentArea.add(console)
setContentPane(contentArea) public
void actionPerformed(ActionEvent
event) if(event.getSource()stop)
stop() if(event.getSource()play)
start() / The AnimPanel class
provides an area in the applet interface on
which to display an animated sequence of
GIF images. / class AnimPanel extends
JPanel
public void paintComponent(Graphics painter)
if( piccount ! null )
painter.drawImage( piccount, 0,
0,this)
50
public void start() if(runner null)
runner new Thread(this) runner.start()
public void run() while (runner
Thread.currentThread() ) repaint()count
if(count gt total) count0 try
Thread.sleep(100) catch(InterruptedException
e) public void stop()if(runner ! null)
runner null
51
Make a ball move same principal we have seen
before But with a thread we set up ourselves
52
import java.awt. import javax.swing. / Demo
of animation with a Runnable implementation.
/ public class SimpleAnimation2 extends
java.applet.Applet implements Runnable Thread
fThread int xm int ym public void start ()
// Create an instance of Thread with a
// reference to this Runnable instance.
fThread new Thread (this) // Start the
thread fThread.start () // start
public void stop () if (fThread ! null)
fThread null // continued
53
public void run() while (fThread ! null)
xm if(xm gtgetHeight())
xm 0 ym 10
repaint() //needs antialiasing badly!
Will do below try
Thread.sleep(30) catch
(InterruptedException e)
54
public void paint(Graphics g)
Graphics2D g2 (Graphics2D) g
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN
G,RenderingHints.VALUE_ANTIALIAS_ON) g.setColor(C
olor.blue) g.drawString("Animation", xm 20,
30) g.fillOval(xm, ym 40, 40,
40) g.drawString("Demo", xm, ym40) g.drawString
("Program", 120, xm30) g.setColor(Color.red) g.
fillOval(xm, ym 40, xm10, xm10) //end
55
Three different animations in one applet Define
the colours of your buttons, also add gifs to
them
56
import java.awt. import java.awt.event. impo
rt javax.swing. //animations from 3 different
classes in one contentArea public class simpleT
extends JApplet implements Runnable,
ActionListener Thread runner
JButton play JButton stop int xm
int ym public void
init() this.setSize(400, 500)
Container
contentArea getContentPane()
GridLayout grid new
GridLayout(4,2) //4 items down 2 things across
(ie the buttons)
contentArea.setLayout(grid)
contentArea.setBackground(Color.yell
ow) //content area but will be covered by
brects inanimations JPanel console new
JPanel() //for buttons FlowLayout flow
new FlowLayout()
//GridLayout flow new GridLayout(1,2) //try
this and comment out above //continued
gtgtgtgtgt
57
//JPanel 'console' console.setLayout(flow) conso
le.setBackground(Color.orange) //JPanel
'console', will hold buttons drawPanel
animation new drawPanel() //instance of first
inner class, all of them use the variables xm
and fm on the thread drawPanel2
animation2 new drawPanel2() //second inner
class drawPanel3 animation3 new
drawPanel3() //third inner class Image
playImage getImage(getDocumentBase(),"accept.gif
") //get an image from project folder mageIcon
playIcon new ImageIcon(playImage) //put gif on
ImageIcon play new JButton("Click To
Start",playIcon) //then put ImageIcon on
button play.setBackground(Color.blue) //here I
make button background red play.addActionListener
(this) //add an action listener to button so it
knows when its been pressed Image
stopImage getImage(getClass().getResource("cance
l.gif"))//get an image from folder where this
class is ImageIcon stopIcon new
ImageIcon(stopImage) stop new JButton("Click
To Stop",stopIcon) stop.setBackground(Color.red)
stop.addActionListener(this) console.add(p
lay) //add buttons to our orange
JPanel console.add(stop) //order will define
what order they are in, try to change
around contentArea.add(animation2) //add
animations to contentArea contentArea.add(animat
ion3) contentArea.add(animation)
// contentArea.add(console) //add the JPanal to
the contentArea
setContentPane(contentArea) //ctd
58
//button actions public void actionPerformed(Actio
nEvent event) if(event.getSource()stop)
stop() if(event.getSource()play)
start() //// class drawPanel
extends JPanel //inner class public void
paintComponent(Graphics painter)
int num (int)(Math.random() 250)
painter.setColor(new Color(255, num, 0))
painter.fillOval(xm23, 20, 25, 25)
painter.setColor(new Color(num, num, 255))
painter.fillOval(xm, ym 40, 10, 10)
public void start() //ctd gtgtgt
59
if(runner null) runner new
Thread(this) runner.start()
public void run() while (runner
Thread.currentThread())
xm //this will move our animations as
the thread goes round and round
if(xmgtgetHeight()) //make them return to left
side xm 0 ym 10
repaint() //keep refreshing try //catch
any problems with the thread, interruptions etc
Thread.sleep(150) catch(InterruptedExcept
ion e) public void stop() if(runner !
null) runner null //continued
60
///////////////////2 class drawPanel2 extends
JPanel public void paintComponent(Graphics
painter) //inherited methiod of JPanel class
int num (int)(Math.random()
250) painter.setColor(Color.orange)
painter.fillRect(0, 0, 400, 200) //comment out
and u will see contentArea's yellow background
painter.setColor(new Color(0, 0, 255))
painter.fillOval(20, 20, xm, xm) //3rd
inner class class drawPanel3 extends JPanel
public void paintComponent(Graphics painter)
int num (int)(Math.random()
250) painter.setColor(Color.magenta)
painter.fillRect(0, 0, 400, 200)
painter.setColor(new Color(0, 255, 255))
painter.fillRect(xm-30, 20, 45, 20)
painter.setColor(new Color(0, 123, 255))
painter.fillRect(20, xm, xm/2, ym)
//end of whole class
61
These examples are really simple, but dont get
the Impression from these that you cant do all
the things in in Java that you can in
Processing,you can, they are just a bit more of
a fiddle to set up..
62
Embedding Applets in HTML Pure Java Applets
Make sure it is the right name for your
applet and the right dimensions
lthtmlgt ltheadgt lttitlegt Hello Everyonelt/titlegt lt/hea
dgt ltbodygt ltapplet code HelloWorld.class
width 300 height 600gt You need a
Java-enabled browser to see this
applet. lt/appletgt lt/bodygt lt/htmlgt
63
Processing Applets, as before but you need to
state where the code is, i.e the .jar file,
referred to in the code as archive (jar
Java Archive)
ltHTMLgtltHEADgtltTITLEgtTest Embedlt/TITLEgtlt/HEADgtltB
ODYgt ltapplet code"webTide.class" width"500"
height"300" archive "webTide.jar"gt lt/appletgt lt
/BODYgtlt/HTMLgt
You will need to upload the .jar file, into the
same folder as The html page, or use a url
ltapplet code"webTide.class" width"500"
height"300" archive"http//www.doc.gold.ac.uk/m
a501ed/myStuff/webTide.jar"gt lt/appletgt
64
ltHTMLgt ltHEADgt ltTITLEgtEmbed appletlt/TITLEgt lt/HEADgt
ltBODYgt ltapplet code"testEmbed.class"
width"200" height"200" archive
"testEmbed.jar"gt lt/appletgt ltapplet
code"testEmbed.class" width"200" height"200"
archive "testEmbed.jar"gt lt/appletgt lt/BODYgt lt/HTM
Lgt Of course they could be two different
applets as long as we refer to the right names
and sizes.
Add as many as you want!
65
You could open that html code in Dreamweaver
(etc) and position the applets wherever you want,
add Images and text etc
66
Passing parameters to applets via HTML can be
done in Java and Processing Next week well look
at that and documentation ARRANGE TUTORIAL TIMES
67
Where we are Week 3 27th Quick interim
presentations project briefs must be ready/Java
GUIs/ threads Week 4 3rd Feb Quick
Tutorials//Java Documentation/Applet
parameters Week 6 10th Feb interim
presentations/getters/setters/ intro to mobile
programming --------------------- 17th- Reading
Week 5 ---------------------------------- Week
7 24th Quick Tutorials/databases intro/ Week
8 3rd March Interim presentations/ Week 9
10th Tutorials / help with projects/ Week 1017th
Final presentation Hand in work (and written
work)
Write a Comment
User Comments (0)
About PowerShow.com