Java Tutorial – Application Building

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

January 2006Daniel Bryant1 Image Processing in Java: A Technical Guide Daniel Bryant Dept. of Computing University of Surrey
January 2006Daniel Bryant1 Coursework Hints (part 2) : Week 4-5 Daniel Bryant Dept. of Computing University of Surrey
Java Tutorial – Building GUIs Java with Added Swing Daniel Bryant
Building Web Pages With Microsoft Office. Introduction This tutorial is for the beginning web builder. It utilizes software that you already have, Microsoft.
Chapter 81 Exception Handling Chapter 8. 2 Reminders Project 5 due Oct 10:30 pm Project 3 regrades due by midnight tonight Discussion groups now.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Cummins® Inc. Update Manager 3.0 Training Electronic Service Tools.
LEGO NXT Robot Programming Introduction to Programming a Lego NXT robot in Java.
Databases Setting up a Database.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Iteration. Adding CDs to Vic Stack In many of the programs you write, you would like to have a CD on the stack before the program runs. To do this, you.
DUE Hello World on the Android Platform.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
CIS3931 – Intro to JAVA 26-May-05 Using JAVA in a Windows environment.
Setting up and getting going with…. MIT App Inventor.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
Installing Repast in the Eclipse IDE Charlie Gieseler 6/28/04.
Creating Applets. What is an applet? What is an applet? A Java program that runs in a web browser. A Java program that runs in a web browser. An applet.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming – Home and reload buttons for the webbrowser, Applets.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
Creating a GUI Class An example of class design using inheritance and interfaces.
CS2102: Lecture on Abstract Classes and Inheritance Kathi Fisler.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Final formatting and checking your 2016 data Please complete before submission in Canvas by Friday, April 22 at midnight Each group member should upload.
Inner Classes.
Inner Classes 27-Dec-17.
FOP: Multi-Screen Apps
Visual Basic.NET Windows Programming
Testing and Debugging.
Using the Excel Creation Template to Create a Variable Parameter Problem (Macro Enabled “Alpha 1.4.2”) Getting started – Example 1 Note – You should be.
Chapter Eleven Handling Events.
“Alice  Java” workshop
Excel in M.E. –Using add-ins
Ellen Walker Hiram College
Completing the tasks for A452 with….
CS2102: Lecture on Abstract Classes and Inheritance
The Little Crab Scenario
How to Run a Java Program
CS288 Lab Exercise 3.
Review and Q/A.
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
MSIS 655 Advanced Business Applications Programming
Tonga Institute of Higher Education
A look at Small basic The Text Window 2017.
Office 365.
Constructors, GUI’s(Using Swing) and ActionListner
Java Tutorial – Application Building
Chapter 5 Processing Input with Applets
Greenfoot November 8, 2009.
Inner Classes 17-Apr-19.
BIT116: Scripting Radio Buttons.
Inner Classes 21-Apr-19.
Finally, let me give you a peek at one of my current projects, Bloom
Getting started – Example 1
Basic Lessons 5 & 6 Mr. Kalmes.
Running a Java Program using Blue Jay.
Inner Classes 11-May-19.
Inner Classes 18-May-19.
Visual Programming week # 05 Lists Quiz Tutorial.
Basic Mr. Husch.
CSCE 206 Lab Structured Programming in C
CMSC 202 Exceptions 2nd Lecture.
Inner Classes 25-Oct-19.
How to use Open study By blm1.
Presentation transcript:

Java Tutorial – Application Building Completing our Application Daniel Bryant csm1db@surrey.ac.uk 12/9/2018 Java Tutorial - Daniel Bryant

Java Tutorial - Daniel Bryant Overview Today we will be tidying the project from the previous Java Tutorial labs and implementing some new functionality Therefore, you must have completed all the work in both Lab 1 and Lab 2 before starting this sheet You should have NetBeans set up correctly i.e. with the appropriate directories Mounted (Remember to mount the Classes directory first then the appropriate Apps directory) You should have the latest version of the MainFrame class compiled and working. This will be a modified version of MainClass4 that you downloaded from the internet 12/9/2018 Java Tutorial - Daniel Bryant

Java Tutorial - Daniel Bryant Last weeks question The final slide of last weeks Lab asked how you would modify the Dither code to prevent the application from terminating when the user closes any window. Therefore, this will be your first task of the day (Hint: the code you need to modify is in the Dither constructor) Can you tell me what you have done and why this code needed to be modified? 12/9/2018 Java Tutorial - Daniel Bryant

Finalising our application You will notice that if you click on your button labelled “Dither the Image” when you haven’t specified an image an error is generated (or “thrown” in Java terminology) but the user is not informed why It would therefore be useful to stop this error from occurring and inform our user that they should select an image. You will need to add an “if” statement to the action listener class for that button to check if a file has been selected (Hint. the myPicture object will be equal to null if no image has been selected) If you have stuck to my examples the class is probably called DoloadApp1 and the method you will need to modify is called public void actionPerformed(ActionEvent e) { 12/9/2018 Java Tutorial - Daniel Bryant

Adding the if statement The code you will write to stop the error occurring will probably look something like this: if(myPicture == null) { JOptionPane.showMessageDialog(null,"Please specify an image first"); } else //The code to open the Dither application should go here 12/9/2018 Java Tutorial - Daniel Bryant

Finalising the Application Now our simple GUI is complete! If you can think of any extra functionality that is needed for the coursework, either look at the tutorials at the sun website (http://java.sun.com) or ask! The next task for the remainder of today and the next few weeks will be to implement the applications for the coursework Today you should attempt to implement the Enlarge code from the book (Listing 5.14) using the Dither code as a template Remember if you get stuck please ask. 12/9/2018 Java Tutorial - Daniel Bryant