Skip to Content

Translate Page

Use of arrow keys when focused on the Google language option field will translate site content on the fly. Use your enter key to review all options and choose your selection before applying.
McFarland School District
McFarland High (9-12)
  • McFarland High (9-12)
    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4
  • Home
  • District
    • Referendum November 5, 2024
      • Impact Tax Calculator
    • Strategic Plan
    • School Board
      • Agendas, Minutes & Notices
      • Board Member Informational Brochure
      • District Policies
      • Meeting Calendar
      • Meeting Recordings
      • Members
      • Non-Discrimination Policy
      • Notice of Educational Options
      • Notices
      • Resolutions
    • Departments & Administration
      • District Administrator Message
        • Tarnutzer's Travels
      • Diversity, Equity, Inclusion & Belonging
      • Administrative Staff
      • Building & Grounds
        • Facility Use / Rental
      • Business Services
      • Finances
      • Health Services
      • McFarland Recreation Activities & Play (MRAP)
        • Current Events / News
        • Community Recreation Partners
      • Public Records Requests
      • School Nutrition
        • Lunch Menus
      • Special Education
        • What is Special Education?
        • Contact Information
        • Resources
      • Student Services
        • Community Resources
        • District Programs
        • Family Resources
        • Student Services Team Members
      • Summer School
      • Teaching & Learning
        • Assessments for Learning
        • Curriculum
        • Wisconsin Academic Standards
        • Early Literacy - Wisconsin Act 20
      • Transportation
        • Bus Safety Videos
        • StopFinder
    • Prospective Families & Staff
      • About McFarland
      • District Boundary Map
      • District Mission & Vision
      • Employment
      • Enrollment Process
        • Online Enrollment
      • Open Enrollment
      • Residency Questions
      • School and District Report Cards
    • Staff Resources
      • Assessment Calendar (District)
      • Assistive Technology
      • Branding/Logos
      • Building & Grounds Info Sheet
      • Calendar Dates - Staff 24-25
      • Calendar Dates - Staff 25-26
      • Canvas Login
      • Educator Effectiveness
      • Employee Assistance Program
      • Employee Handbook
      • FAQ - Employee Services
      • Field Trip Requests
      • Finance Forms
      • FMLA
      • Fundraising
      • Hiring Procedure
      • HR and Business Services
      • HR HERMAN
      • Infinite Campus Staff Login
      • Insurance
      • Maintenance & Facilities Requests
      • Mentoring Resources
      • Payroll Forms
      • PD Points Tracker
      • SeeSaw Staff Login
      • Skyward
      • Student Teacher
      • Substitute Request
      • Technology (IT) Help Desk
      • Technology Department
      • Technology Orientation
      • Time-Off
      • TSG Info & Timelines
      • Web Site Admin
      • WECAN Links
      • Xello - Staff Login
  • Families
    • All
      • 2024-2025 School Hours
      • 2024-2025 Calendar Dates
      • 2025-2026 Calendar Dates
      • Calendar - All District
      • Canvas Login
      • Communications
      • Daily Schedules
      • Emergency Protocol
      • Handbooks
      • McFarland Mobile App
      • Online Registration
        • Registration Documents
      • Safety
      • Safety and Bullying Tip Line - SUSO
      • School and District Report Cards
      • Social Media
      • Spartan Headquarters
      • Supply Lists
    • Students
      • Canvas Student Login
      • Library Resources
    • Parents/Guardians
      • Absence Reporting
      • Advanced Learner (GT)
      • Canvas Parent Login
      • Drug & Alcohol Resources
      • Dyslexia Information Guide
      • English Learners (EL)
        • Eligibility
        • Philosophy
        • DPI Language Levels
        • Resources
      • Gun Safety Resources
      • Human Growth & Development Booklet
      • Joining Forces for Families
      • McFarland Music Boosters
      • School Nutrition
      • Special Education
      • Transportation
      • Volunteer Application & Disclosure Form
      • Volunteer Handbook
      • Weather Cancellation Days
    • Important Links
      • ACT Prep
      • Drivers Ed
      • Google Apps
      • Infinite Campus
      • Lunch Menus
      • McFarland Public Library
      • Summer School
      • Work Permits
      • Xello - Student (w/Free ACT Method Test Prep
    • Other
      • McFarland Thistle
      • McFarland Youth Center
      • Outdoor Programs
        • Resources
      • McFarland School Forest
        • Bird Boxes
        • Bird Feeders
        • Bird Song Board
        • Fauna
        • Flora
        • Habitats
        • Silver Award
        • Our Supporters
  • Community
    • Community Pool
    • Facilities Use / Rental
    • McFarland Education Foundation (MEF)
    • McFarland Performing Arts Center (PAC)
    • McFarland Public Library
    • McFarland Recreation, Activities & Play(MRAP)
    • School Visitors
    • Summer School
    • Village of McFarland
  • Contact Us
    • District Office
    • School Offices
    • Staff Directory
    • Web Site Feedback
    • Spartan Shout Outs
  • A-Z Links
  • Staff Resources
  • Website Guide - Learn Your Way Around
  • 2024-2025 Calendar Dates
  • 2025-2026 Calendar Dates
  • See Something Say Something Reporting

Schools

  • McFarland Primary School (4K-2)
  • Waubesa Intermediate (3-5)
  • Indian Mound Middle (6-8)
  • McFarland High (9-12)
  • Online Virtual Charter Schools
District Home

Important Links

  • Canvas Login
  • District Calendar
  • Lunch Menus
  • Infinite Campus - Student/Parent
  • Infinite Campus - Staff
  • Staff Directory

Project - NetBeans

McFarland High (9-12)

    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4
    • McFarland High School
    • Academic & Career Planning (ACP)
      • Youth Apprenticeship
    • Athletic & Activity Code of Conduct
    • Canvas Login
    • Clubs
    • Communications
    • Course Supply List
    • Daily Announcements
    • Daily Schedules
    • Family Handbook
    • Grading Handbook
    • Graduation Information
    • Library Media Services
    • Music
    • Office Staff
    • PBIS
    • Portfolio Resources
    • Progressive Behavior Response Plan
    • Report Suspicious Activity
    • School To Career
    • Spartan Headquarters
    • Special Education
    • Sports
      • Boys Teams
        • Baseball
        • Basketball
        • Football
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Swimming
        • Tennis
      • Coed Teams
        • Cross Country
        • Track & Field
        • Wrestling
      • Girls Teams
        • Basketball
        • Dance
        • Golf
        • Hockey
        • Lacrosse
        • Soccer
        • Softball
        • Swimming
        • Tennis
        • Volleyball
      • 24-25 Sport Registration-Athletic Code Video
      • Athletic & Activity Code of Conduct
      • Concussion & Sudden Cardiac Arrest Info
      • Infinite Campus Sport Registration Info Sheet
      • Parent Resources
      • Parent Transportation Form
      • Spartan Sport Sponsors
      • Uniform Care Info
      • WIAA Medical Eligibility Form
    • Staff Directory
    • Student Services
      • Transcript Request (former students)
    • Xello - Student
    • Web Design 1
      • Class Lessons
        • XHTML Tutorial
        • CSS Tutorial
        • Form Tutorial
        • Graphics
        • Dreamweaver
        • QuickMenu
        • Joomla!
      • Assignments
        • Site 1: Biography
        • Site 2: Fan Club
        • Site 3: Mixed Media
        • Site 4: Joomla!
      • Student Samples
        • Biography Sites
        • Fan Club Sites
        • Mixed Media Sites
        • Joomla! Sites
      • Helpful Sites
        • XHTML Help
        • CSS Help
        • Validation
        • QuickMenu
        • Joomla! Help
    • Web Design 2
      • Class Lessons
        • JavaScript Tutorial
        • PHP Tutorial
        • MySQL Tutorial
        • Admin - CMS
      • Assignments
        • Using JavaScript
        • For the Birds
      • Helpful Sites
        • JavaScript Tutorials
        • RegExp Help
        • Web Page Validation
    • Programming 1
      • Class Lessons
        • CLASS SET-UP
        • Logic Test
        • Class Preparation
        • Using BlueJ
        • --------------------
        • SET 1 LESSONS:
        • Printing
        • Variables
        • User Input
        • Random Number
        • Arithmetic
        • --------------------
        • SET 2 LESSONS:
        • If
        • Switch
        • --------------------
        • SET 3 LESSONS:
        • Looping
        • --------------------
        • SET 4-5 LESSONS:
        • Arrays
        • --------------------
        • SET 6 LESSONS:
        • String Manipulation
      • Problem Sets
        • Set 1: Basic Skills
        • Set 2: If & Switch
        • Set 3: Loops
        • Project: Craps
        • Set 4: Single Array
        • Set 5: Double Array
        • Set 6: Strings
      • Solution Sets
        • Problem Set 1
        • Problem Set 2
        • Problem Set 3
        • Problem Set 4
        • Problem Set 5
        • Problem Set 6
      • Helpful Sites
    • Programming 2
      • Class Lessons
        • Using BlueJ
        • What is an Object?
        • What is a Class?
        • GUI Programming
      • Problem Sets
        • Set 1 - Shapes
        • Set 2 - Exercises
        • Set 3 - Exercises
        • Set 4 - Exercises
        • Project - Adding
        • Set 5 - GUI by Hand
        • Project - NetBeans
        • Set 6 - NetBeans
        • Project - Life
        • Project - Slide Puzzle
        • Project - Matching
      • Solution Sets
        • Problem Set 1 (none)
        • Problem Set 2 (none)
        • Problem Set 3 (none)
        • Problem Set 4

NetBeans - Creating a GUI Program

 

  1. Open the program named NetBeans.
  2. If you have not done so already create a folder in your I: drive named Programming 2
  3. From the File menu choose New Project. Select Java from the Categories list and Java Application from the Projects list. Press the Next button.

     
  4. Enter a project name. Browse to your I: drive Programming 2 folder. (Note: the computer will create a folder using the project name within the Programming 2 folder) Deselect the "Create Main Class” check box and finally press the Finish button.

     
  5. In the NetBeans program choose New File from the File menu.

     
  6. In the New File window select Swing GUI Forms for the Category and JFrame Form for the File Type. Press the Next button. Press the Finish button.
     
     
  7. In the Inspector panel (lower left corner of window) select JFrame, Right-click to select Set Layout and then Null Layout.

     
  8. Again, in the Inspector panel select the JFrame. In the [JFrame] - Properties palette (lower right corner of window) select the Code button. (NOTICE: the Code button may not be visible until you select the Properties button once) Set the Form Size Policy to Generate Resize Code. Doing this allows you to make the window for your application any size.

     
  9. From the Swing Containers palette drag a Panel to the JFrame of the project.

     
  10. In the Inspector palette right-click on the JPanel object jPanel1. Select Set Layout, Null Layout.

     
  11. Grab the corner handles and resize the JPanel to fill the entire JFrame.

     
  12. Select the JPanel. In the jPanel1 [JPanel] - Properties palette. select the background property and select a yellow color. Press the OK button.

     
  13. From the Run menu select Run Main Project. Press the OK button when asked to select the main class. Close the application after you are done viewing it.

     
  14. In the Inspector select the JFrame. In the Properties palette enter a title.

     
  15. Run the project again and notice that the window has a title. Close the application.

     
     
  16. Next we will add a label. Labels are used to display text. Drag a Label from the Swing Controls palette onto the Panel of the project. In the Properties palette select the Code button. Change the Variable Name from the default value of jLabel1 to lblNum1. The variable name is the instance name used when coding in Java.

     
  17. The label currently displays the default text, JLabel1. To change the text select the text property in the Properties palette and enter the text Enter a number: . On the JPanel drag the resize handles so that all of the text is visible.

     
  18. From the Swing Controls palette drag a Text Field object onto the project. In the Properties palette clear the default text. In the Code area of the Properties palette change the Variable Name to txtNum1.

     
  19. Add another Label. Give it a Variable Name of lblNum2 and a text value of Enter another number: .
    Add another Text Field to the form. Give it a Variable Name of txtNum2 and clear the text so that it is empty.


     
  20. Add another Label. Give it a Variable Name of lblChooseFunction and a text value of Select a math function: .

     
  21. Drag a Button Group object from the Swing Controls palette onto the form. Although nothing visibly changed on the form you can see in the Inspector palette that a Button Group object named buttonGroup1 was added. In the Inspector click on the Button Group object so that it is selected. In the Properties palette, code area, change the Variable Name to MathFunctions.

     
  22. Drag a Radio Button object from the Swing Controls palette onto the form. Change the text property to Add. Select the buttonGroup MathFunctions. Change the background property to the same yellow color as the JPanel.  Change the Variable Name to optAdd.

     
  23. Add three more Radio Buttons to the form. Change their background to yellow.
    Add all of them to the MathFunctions buttonGroup.
    Change the text to Subtract, Multiply and Divide for the three buttons.
    Use the Variable Names optSubtract, optMultiply and optDivide.


     
  24. Drag a Button from the Swing Controls palette onto the form.
    • In the Code area of the Properties palette change the Variable Name to btnSolve.
    • Select private static for the Variable Modifiers property (if you don't do this the color will not appear when the code is executed).
    • In the Properties palette change the text to Solve.
    • Select the ContentAreaFilled property.
    • Deselect the focusPainted property.
    • Select the Opaque property.
    • Change the background property to give the button some color.
    • Change the foreground property to change the color of the text of the button.
    • Change the border property to Bevel Border.


       
  25. Add another Button to the form.
    • In the Code area of the Properties palette change the Variable Name to btnExit.
    • Select private static for the Variable Modifiers property
    • In the Properties palette change the text to Exit.
    • Select the ContentAreaFilled property.
    • Deselect the focusPainted property.
    • Select the Opaque property.
    • Change the background property to give the button some color.
    • Change the foreground property to change the color of the text of the button.
    • Change the border property to Bevel Border.
  26. Add a Label to the form.
    • In the Properties palette delete the default text from the text property.
    • In the Code area of the Properties palette change the Variable Name to lblResults.
  27. Now that the form is complete we will execute the program to make sure that the appearance is OK. Press the Run Main Project button.

     
  28. Notice that the labels all appear as bold text. This causes the text to increase in size which causes the text to no longer fit in the space assigned. (Notice: before continuing with this step you can avoid this entire issue by following the directions on how to resolve the 'Look and Feel" issue found at the bottom of this page.)

    If you have not corrected the Look and Feel issue as described at the end of this tutorial then on the form, increase the size of each element so that when executed the text is displayed correctly. You may have to make several attempts to get the correct appearance. (Note: The lblResults JLabel is transparent. It too needs to be adjusted. To select lblResults select it in the Inspector palette so that it appears selected on the form.)


     
  29. Now it is time to add the Java code so that program actually does something useful. The first thing we will do is add code to the btnExit element. Right-click on the cmdExit button. Select Events, Mouse, mouseClicked.


     
  30. The computer has now left the Design view and entered the Source view. If you scroll through the code you will find that all of the necessary code has been written to display your project. The computer is now waiting for you to write the code for the btnExit button. The computer has already entered:

    private void btnExitMouseClicked(java.awt.event.MouseEvent evt) {
    // TODO add your handling code here:
        }


    In order to make the program terminate change the code to:

    private void btnExitMouseClicked(java.awt.event.MouseEvent evt)     {                                    
      System.exit(0);
    } 

     
    Run the program to confirm that the btnExit button works.

     
  31. Next we will add code to the btnSolve button. Right-click on the btnSolve button. Select Events, Mouse, mouseClicked. Add the following code:

            String enteredNum1,enteredNum2;
            int num1=0,num2=0,result=0,remainder=0;
            enteredNum1=txtNum1.getText();
            enteredNum2=txtNum2.getText();
            num1=Integer.parseInt(enteredNum1);
            num2=Integer.parseInt(enteredNum2);
            if(optAdd.isSelected()==true)
            {
                result=num1+num2;
                lblResults.setText("The answer is "+result);
            }
            else if (optSubtract.isSelected()==true)
            {
                result=num1-num2;
                lblResults.setText("The answer is "+result);
            }
            else if (optMultiply.isSelected()==true)
            {
                result=num1*num2;
                lblResults.setText("The answer is "+result);
            }
            else if (optDivide.isSelected()==true)
            {
                result=num1/num2;
                remainder=num1%num2;
                lblResults.setText("The answer is "+result+" with a remainder of "+remainder);
            }   
            else
            {
                lblResults.setText("You have not chosen a math function.");
            }



     
  32. Run the completed program to make sure that it functions correctly.

 

Directions to fix the Look and Feel issue:

To stop the font size error you will need to add the code shown below to the main method. Press the Source button to view the code for your project. Find the main method. Copy the code below and then paste just after the line public static void main(String args[]) {

// this code assumes the form is named NewJFrame which is the default name generally
try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception ex) {
      Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, "Error setting LaF", ex);}


After adding the above code you need to add the following two lines of code at the very top of the source code window:

import javax.swing.*;
import java.util.logging.*;

Run your program to verify that the output view is the same as the design view in NetBeans.

McFarland School District Home

McFarland School District

Grades: 9 - 12

Contact Information

  • McFarland High School (9-12)

    5103 Farwell Street
    McFarland, WI 53558
  • Phone

    608 838-3166
  • Fax

    608 838-4562

Social Media

  • McFarland School District Social Facebook
  • McFarland School District Social Instagram
McFarland School District Mark

© 2025 McFarland School District

  • Non-Discrimination Statement
CMS4Schools