first commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#BlueJ class context
|
||||
comment0.params=
|
||||
comment0.target=ImageViewer()
|
||||
comment0.text=\n\ Create\ an\ ImageViewer\ show\ it\ on\ screen.\n
|
||||
comment1.params=
|
||||
comment1.target=void\ makeFrame()
|
||||
comment1.text=\n\ Create\ the\ Swing\ frame\ and\ its\ content.\n
|
||||
numComments=2
|
@@ -0,0 +1,41 @@
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* ImageViewer is the main class of the image viewer application. It builds
|
||||
* and displays the application GUI and initialises all other components.
|
||||
*
|
||||
* To start the application, create an object of this class.
|
||||
*
|
||||
* @author Michael Kölling and David J. Barnes.
|
||||
* @version 0.1a
|
||||
*/
|
||||
public class ImageViewer extends JFrame
|
||||
{
|
||||
|
||||
/**
|
||||
* Create an ImageViewer show it on screen.
|
||||
*/
|
||||
public ImageViewer()
|
||||
{
|
||||
super("ImageViewer");
|
||||
makeFrame();
|
||||
}
|
||||
|
||||
// ---- swing stuff to build the frame and all its components ----
|
||||
|
||||
/**
|
||||
* Create the Swing frame and its content.
|
||||
*/
|
||||
private void makeFrame()
|
||||
{
|
||||
Container contentPane = getContentPane();
|
||||
|
||||
JLabel label = new JLabel("I am a label. I can display some text.");
|
||||
contentPane.add(label);
|
||||
|
||||
pack();
|
||||
setVisible(true);
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
Project: imageviewer, version 0.1a
|
||||
Authors: David Barnes and Michael Kölling
|
||||
|
||||
This project is part of the material for the book
|
||||
|
||||
Objects First with Java - A Practical Introduction using BlueJ
|
||||
Sixth edition
|
||||
David J. Barnes and Michael Kölling
|
||||
Pearson Education, 2016
|
||||
|
||||
It is discussed in chapter 13.
|
||||
|
||||
To use this project, create an instance of class ImageViewer.
|
||||
For details, refer to the book chapter.
|
@@ -0,0 +1,29 @@
|
||||
#BlueJ package file
|
||||
objectbench.height=76
|
||||
objectbench.width=665
|
||||
package.editor.height=395
|
||||
package.editor.width=557
|
||||
package.editor.x=70
|
||||
package.editor.y=80
|
||||
package.numDependencies=0
|
||||
package.numTargets=1
|
||||
package.showExtends=true
|
||||
package.showUses=true
|
||||
project.charset=UTF-8
|
||||
readme.editor.height=571
|
||||
readme.editor.width=843
|
||||
readme.editor.x=53
|
||||
readme.editor.y=23
|
||||
target1.editor.height=819
|
||||
target1.editor.width=890
|
||||
target1.editor.x=963
|
||||
target1.editor.y=71
|
||||
target1.height=60
|
||||
target1.name=ImageViewer
|
||||
target1.naviview.expanded=false
|
||||
target1.showInterface=false
|
||||
target1.type=ClassTarget
|
||||
target1.typeParameters=
|
||||
target1.width=110
|
||||
target1.x=170
|
||||
target1.y=120
|
Reference in New Issue
Block a user