first commit

This commit is contained in:
Boris
2024-01-15 20:14:10 +00:00
commit 8c81ee28b7
3106 changed files with 474415 additions and 0 deletions

View File

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

View File

@@ -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);
}
}

View File

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

View File

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