2-d environment

Assignment Help Computer Networking
Reference no: EM13910684

1.Write a class called point

for the 2-D environment.

Select appropriate variable(s).

Write constructors.

Write access methods for the variables.

Write a Print method to display the variables when called.

Write a test program to test it.

2.Write a class called square,

which inheres the above point class.

Select appropriate variable(s).

Write constructors.

Write access methods for the variables.

Override the inherited print method to display variable in square and point.

Write a test program to test it.

3.Start from the following code, and add Action Listener to make it functional. (Need about 10 lines)

Note: 1 lb = .0.453592 kg.

import javax.swing.*;

import

java.awt.GridLayout;

import

java.awt.event.*;

import

java.text.DecimalFormat;

public class weightConverter extends JFrame {

public static void

main(String[] args) {

JFrame frame = new weightConverter();

frame.setTitle("Weight");

frame.setSize(200, 100);

frame.setLocationRelativeTo(null);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

}

public

weightConverter() {

JLabellbllb = new JLabel("lb",SwingConstants.CENTER);

JLabellblkg = new JLabel("kg",SwingConstants.CENTER);

final

JTextFieldjtflb = new JTextField();

final

JTextFieldjtfkg = new JTextField();

JButtonjbtLeft = new JButton("<=");

JButtonjbtRight = new JButton("=>");

JPanel panel = new JPanel(new GridLayout(2, 3));

panel.add(lbllb);

panel.add(jbtLeft);

panel.add(lblkg);

panel.add(jtflb);

panel.add(jbtRight);

panel.add(jtfkg);

this.add(panel); // Add panel to the frame

final

DecimalFormatdec = new DecimalFormat("#.00");

}

}

4.Start from the given class, and create a NewPanel class to draw a figure like below. (Need about 15 lines)

import javax.swing.*;

import

java.awt.Graphics;

import java.awt.Color;

public class drawPerson extends

JFrame {

public

drawPerson() {

add(new

NewPanel());

}

public static void

main(String[] args) {

drawPerson frame = new drawPerson();

frame.setTitle("Person");

frame.setSize(200, 200);

frame.setLocationRelativeTo(null); // Center the frame 

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);  

}

}

The circle coordinate and size is (80, 15, 20, 25).

The text coordinate is (70, 135).

The starting and ending lines coordinate are

(90, 40, 90, 80);

(60, 50, 120, 50);

(90, 80, 70, 120); and

(90, 80, 110, 120).

Color pink, with text color magenta.

Reference no: EM13910684

Questions Cloud

Standard error and standard error : The standard error of the estimate (standard error) is the estimated standard error of the distribution of the independent variable (X).
Old town alexandria and reston : He rented a location-bought 10 bikes and opened his first store in Vienna near an entrance to the W&OD Trail-where there is also parking-and near the historic Vienna Inn and a number of food and drink establishments-He has since opened stores in O..
Which choice has the greater present value if all banks pay : You win a lottery. You have the choice of two ways to be paid. If you pick Payout Scheme X, you get $2,750 today. If you pick Payout Scheme Y, you get three payments: $1,000 today, $1,000 one year from today, and $1,000 two years from today. Which ch..
What are naomi taxable income items : What are Naomi's taxable income items from these events for 2011? How much may the employer deduct for these expenses in years 1 and 2?
2-d environment : Write a class called point for the 2-D environment. Select appropriate variable(s). Write constructors. Write access methods for the variables.
The focus is to write sql queries that combine data : This is the final installment of the project! The focus is to write SQL queries that combine data from both Mondial and GapMinder (GM). For most queries you will need both Mondial and GM data, so you may need to use your bridge table(s).
Difference between the interest expense and interest paid : What was the difference between the interest expense and interest paid in 2013-How much long-term debt will mature in 2014
Meqa assignment 1 : MEQA Assignment 1, 1. Estimate an empirical demand function for QuickKits™.2. Interpret the estimated demand function for QuickKits™.3. Make pertinent recommendations to senior management based on the empirical demand function.
Implements the features of the minesweeper game : The map generator generates a rectangle matrix of 9 rows and 10 columns, and each cell of the matrix contains an integer 0 or 1 only. Such a matrix represents the map of the minesweeper game - write a Windows Console Application that implements mos..

Reviews

Write a Review

Computer Networking Questions & Answers

  Learn as much as possible about that ip address

Using tools that are freely available in the Web, learn as much as possible about that IP address (Domain name, owner, physical location, address, etc.)

  Explain about backbone networks

Discuss the advantages and disadvantages of each approach and describe an example of a situation where a switched backbone would be preferred.

  Describe the network configuration

For the networking report, describe the network configuration, explaining the role of each component and connection, following the diagram provided by your supervisor.

  Define computer crime and computer fraud

Define computer crime and computer fraud. In what ways are they different

  Determine result of scrambling sequence using techniques

Determine the result of scrambling sequence 11100000000000 by using one of the following scrambling techniques? Suppose that last non-zero signal level has been positive.

  What activity is a burst activity

Draw a project network from the following information. What activity(s) is a burst activity? What activity(s) is a merge activity

  Comprehensive authentic assessment plan

Comprehensive Authentic Assessment Plan Deliverables- For this course AAP is a response for customer's RFP or customer's design requirements and type of solution used in network design

  Discuss security implications for netbooks

Why do you think companies often fail to harden their servers adequately? Justify your explanation.

  Create state transition diagram that explains patient states

Create a state transition diagram that describes typical patient states and how they change based on specific actions and events.

  Cost and quality create a work breakdown structure wbs and

create a work breakdown structure wbs and assign resources and cost by using a project management tool. as the it

  List five companies that provide p2p file-sharing services

List five companies that provide P2P file-sharing services. Identify what types of files P2P file-sharing services can deliver, and if there are different approaches for different file types.

  Create a work breakdown structure

Create a Work Breakdown Structure, and assign resources and cost by using a project management tool - satisfy the scope of the project such as training, wiring, consulting efforts

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd