Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int sum(int a, int b, int c) return a b1 class Example3 f oublic static void nain(string argst Parentclass p new Chiloclass) Systen out.printin(p.sun(5, s,

image text in transcribed

int sum(int a, int b, int c) return a b1 class Example3 f oublic static void nain(string argst Parentclass p new Chiloclass) Systen out.printin(p.sun(5, s, 5) System.out.printin(p.sum(s, s)): System.out.println(p.x); There is a Graphic User Interface program ButtonDemo in the following, with layoat 2. Flow Layout, one text field (type: JTextField, width 20) and two buttons (JButton, manager Kand "Cancel"). When button OK (or Cancel) is clicked, string You clicked Ok !" (or "You clicked Cancel button:") will be shown in the text field. (10 marks) button Button Demo- You clicked an attorn OK Cancel import java, awt,* import java.awt. event. public class ButtonDemo import the whole swing package { private JTextField text; private 3Button okButt, cancelButt; public ButtonDemo() 1f super("Button Deno) setsize(25e, 1ee) Set up the defuult close operation to Exit ON CLOSE c getContentPane(); Container /Set the lay out to FlowLayout managesr text new JTextField(28); okButt-new JButton("OK"); cancelButt new JButton("Cancel"); c.add(text); c.add (okButt); c.add(cancelButt); //Register the listener to the OK button /Register the listener to the Cancel buton /Set the frame to be visible .s. -o

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions