In Java Develop, test, and execute a graphics application for simulations using Java. Create a Java application. Given a...

90.2K

Verified Solution

Question

Programming

In Java

  1. Develop, test, and execute a graphics application forsimulations using Java.
  2. Create a Java application.
  3. Given a set of events, choose the resulting programmingactions.
  4. Understand the principles behind Java.
  5. Understand the basic principles of object-oriented programmingincluding classes and inheritance.

Deliverables

  • .java files as requested below.

Requirements

  1. Create all the panels.
  2. Create the navigation between them.
    1. Start navigation via the intro screen.
    2. The user makes a confirmation to enter the main panel.
    3. The user goes to the main panel and from the main panel theuser can go to each game panel and back to the main panel.
    4. The user can go to the game over panel.
  3. Many panels will be very simple at the beginning, playing justthe role of a placeholder.
    1. For instance, game 1 might just a panel with a button saying\"game 1 will be here\" and a button to go back to the main map.

Answer & Explanation Solved by verified expert
3.9 Ratings (636 Votes)
Sample OutputCode to CopyIntrojava import the necessary packageimport javaxswingimport javaawtevent Declare the classpublic class Intro extends JPanel static JFrame frame Declare the constructor public Intro initComponents SuppressWarningsunchecked declare method private void initComponents jLabel1 new JLabel mainMap new JButton options new JButton instructions new JButton credits new JButton Display text message jLabel1setTextWelcome toGame Set the text mainMapsetTextMain Map Action listener to the mainMap mainMapaddActionListenernewActionListener public voidactionPerformedActionEvent evt mainMapActionPerformedevt set the text and call the actionlistener optionssetTextOptions optionsaddActionListenernewActionListener public voidactionPerformedActionEvent evt optionsActionPerformedevt set the text and call the actionlistener instructionssetTextInstructions instructionsaddActionListenernewActionListener public voidactionPerformedActionEvent evt instructionsActionPerformedevt set the text and call the actionlistener creditssetTextCredits creditsaddActionListenernewActionListener public voidactionPerformedActionEvent evt creditsActionPerformedevt Set the layout of thepanel GroupLayout layout newGroupLayoutthis thissetLayoutlayout layoutsetHorizontalGrouplayoutcreateParallelGroupGroupLayoutAlignmentLEADING addGrouplayoutcreateSequentialGroup addGrouplayoutcreateParallelGroupGroupLayoutAlignmentLEADING addGrouplayoutcreateSequentialGroupaddGap157 157157addComponentjLabel1 addGrouplayoutcreateSequentialGroupaddContainerGapaddComponentmainMap addGap37 3737addComponentoptionsaddGap35 35 35 addComponentinstructionsaddGap39 3939addComponentcredits addContainerGapGroupLayoutDEFAULTSIZEShortMAXVALUE layoutsetVerticalGrouplayoutcreateParallelGroupGroupLayoutAlignmentLEADING addGrouplayoutcreateSequentialGroupaddGap45 4545addComponentjLabel1addGap52 52 52 addGrouplayoutcreateParallelGroupGroupLayoutAlignmentBASELINEaddComponentmainMap addComponentoptionsaddComponentinstructionsaddComponentcredits addContainerGap36 ShortMAXVALUE Definition of the method private void mainMapActionPerformedActionEvent evt Introframedispose new MainMapIntroframe definition of the method private void creditsActionPerformedActionEvent evt Introframedispose new CreditsPanelIntroframe definition of the method private void instructionsActionPerformedActionEventevt Introframedispose newInstructionsPanelIntroframe definition of the method private void optionsActionPerformedActionEvent evt Introframedispose newOptionsPanelIntroframe Start the main method public static void mainString args frame new JFrame framesetContentPanenewIntro framesetSize500 200 framesetLocationRelativeTonull framesetVisibletrue framesetTitleGameIntroduction framesetResizablefalse framesetDefaultCloseOperationJFrameEXITONCLOSE declare variables private JButton credits private JButton instructions private JLabel jLabel1 private JButton mainMap private JButton optionsMainMapjavaimport the necessary packageimport javaxswingimport javaawteventDeclare the classpublic class MainMap extends JPanel JFrame introScreen JFrame frame Declare the constructor public MainMapJFrame introScreen thisintroScreen introScreen frame new JFrame framesetContentPanethis framesetSize500 200 framesetLocationRelativeTonull framesetVisibletrue framesetTitleMain Game framesetResizablefalse framesetDefaultCloseOperationJFrameDISPOSEONCLOSE initComponents    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students