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

  Networking and types of networking

This assignment explains the networking features, different kinds of networks and also how they are arranged.

  National and Global economic environment and ICICI Bank

While working in an economy, it has a separate identity but cannot operate insolently.

  Ssh or openssh server services

Write about SSH or OpenSSH server services discussion questions

  Network simulation

Network simulation on Hierarchical Network Rerouting against wormhole attacks

  Small internet works

Prepare a network simulation

  Solidify the concepts of client/server computing

One-way to solidify the concepts of client/server computing and interprocess communication is to develop the requirements for a computer game which plays "Rock, Paper, Scissors" using these techniques.

  Identify the various costs associated with the deployment

Identify the various costs associated with the deployment, operation and maintenance of a mobile-access system. Identify the benefits to the various categories of user, arising from the addition of a mobile-access facility.

  Describe how the modern view of customer service

Describe how the greater reach of telecommunication networks today affects the security of resources which an organisation provides for its employees and customers.

  Technology in improving the relationship building process

Discuss the role of Technology in improving the relationship building process Do you think that the setting of a PR department may be helpful for the ISP provider? Why?

  Remote access networks and vpns

safekeeping posture of enterprise (venture) wired and wireless LANs (WLANs), steps listed in OWASP, Securing User Services, IPV4 ip address, IPV6 address format, V4 address, VPN, Deploying Voice over IP, Remote Management of Applications and Ser..

  Dns

problems of IPV, DNS server software, TCP SYN attack, Ping of Death, Land attack, Teardrop attack, Smurf attack, Fraggle attack

  Outline the difference between an intranet and an extranet

Outline the difference between an intranet and an extranet A programmer is trying to produce an applet with the display shown in Figure 1 below such that whenever one of the checkboxes is selected the label changes to indicate correctly what has..

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