Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import java.awt.Color; public

import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import java.awt.Color;

public class SlideShow extends JFrame {

//Declare Variables private JPanel slidePane; private JPanel textPane; private JPanel buttonPane; private CardLayout card; private CardLayout cardText; private JButton btnPrev; private JButton btnNext; private JLabel lblSlide; private JLabel lblTextArea;

/** * Create the application. */ public SlideShow() throws HeadlessException { initComponent(); }

/** * Initialize the contents of the frame. */ private void initComponent() { //Initialize variables to empty objects card = new CardLayout(); cardText = new CardLayout(); slidePane = new JPanel(); textPane = new JPanel(); textPane.setBackground(Color.BLUE); textPane.setBounds(5, 470, 790, 50); textPane.setVisible(true); buttonPane = new JPanel(); btnPrev = new JButton(); btnNext = new JButton(); lblSlide = new JLabel(); lblTextArea = new JLabel();

//Setup frame attributes setSize(800, 600); setLocationRelativeTo(null); setTitle("Top 5 Destinations SlideShow"); getContentPane().setLayout(new BorderLayout(10, 50)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Setting the layouts for the panels slidePane.setLayout(card); textPane.setLayout(cardText); //logic to add each of the slides and text for (int i = 1; i <= 5; i++) { lblSlide = new JLabel(); lblTextArea = new JLabel(); lblSlide.setText(getResizeIcon(i)); lblTextArea.setText(getTextDescription(i)); slidePane.add(lblSlide, "card" + i); textPane.add(lblTextArea, "cardText" + i); }

getContentPane().add(slidePane, BorderLayout.CENTER); getContentPane().add(textPane, BorderLayout.SOUTH);

buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 10));

btnPrev.setText("Previous"); btnPrev.addActionListener(new ActionListener() {

@Override public void actionPerformed(ActionEvent e) { goPrevious(); } }); buttonPane.add(btnPrev);

btnNext.setText("Next"); btnNext.addActionListener(new ActionListener() {

@Override public void actionPerformed(ActionEvent e) { goNext(); } }); buttonPane.add(btnNext);

getContentPane().add(buttonPane, BorderLayout.SOUTH); }

/** * Previous Button Functionality */ private void goPrevious() { card.previous(slidePane); cardText.previous(textPane); } /** * Next Button Functionality */ private void goNext() { card.next(slidePane); cardText.next(textPane); }

/** * Method to get the images */ private String getResizeIcon(int i) { String image = ""; if (i==1){ image = "

Here is the question....

Watch the Product Owner and Scrum-agile Team Animation interaction between the Product Owner and the rest of the Scrum Team. A text version of the animation is available here: CS 250 Product Owner and Scrum-agile Team Animation Text Version.

As the developer, you have been asked to modify existing code so that it fulfills the new requirements from the Product Owner.

  1. Download the Slide Show.zip file for the updated Slide Show control the Product Owner gave you in Module Four, and import it into Eclipse.
  2. Update the Slide Show control with pictures and text for the new requirements specified by the Product Owner this week. Note: Carefully read through the code that you have been given first. Be sure to only change the elements related to the updated requirements from the Product Owner.
  3. Provide specific comments that explain the purpose of lines or sections of your code and detail the approach and method you took to achieve a specific task in the code.
  4. After you have finished completing your assignment, check the code you created. Ask yourself the following questions as you review your work:
    • Did I revise all appropriate sections of code related to the new requirements?
    • Is the software functional?
    • Did I add comments to explain the changes I made and why I made them?

Guidelines for Submission

Export your Eclipse Java Project to an executable JAR file. This will include the source code and the image files so the full basic Slide Show control can run. Next, compress (zip) your JAR file and submit your zipped folder to Brightspace.

Note: For additional instructions on how to create an executable JAR file, watch the following video: SNHU Export Files to JAR. For additional instructions on how to compress (zip) files, review the Compressing Files in Windows tutorial.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

1. Explain the 2nd world war. 2. Who is the father of history?

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago