Only button OK is displayed Both button OK and button Cancel are displayed, button OK is displayed on the right side of button OK Only button Cancel is displayed Both button OK and button Cancel are displayed, button OK is displayed on the left side of button OK
Q: Write a statement that displays each of the following numeric variables in a message box. a.…
A: The “MessageBox.Show ()” method accepts only string parameters. If the user directly passes variable…
Q: TextBox1.Text ="Sure" +" "+" I will continue"; Else { TextBox1.Text = "Sorry, I unable to continue";…
A: TextBox: It is an input control for receiving user input. We may either write code or use the drag…
Q: This control has a rectangular area that functions like a text box. 1. List box 2. Drop-down list…
A: You can use a list box, drop-down list box, or combo box to present a list of items from which the…
Q: First parameter is the user's score. • Second parameter is the required score. xamples…
A: Algorithm - Create a class and create a method to to pass or fail on behalf of the persentage. Now…
Q: The __________ property holds the text that is displayed on the face of the button. a. Name b. Text…
A:
Q: e with comments and output screenshot. Thank you!
A:
Q: True or False : When you assign an access key to a button, the user can trigger a Click event by…
A: It's true that while assigning an access key to a button, the user can trigger a Click event by…
Q: CREATE FLOWCHART Question: To print the area of different shapes based on user input. The user can…
A: Flow chart: It is used to represent program steps in the pictorial representation. Using the flow…
Q: An expression can contain arithmetic, comparison, and logical operators. Indicate the order of…
A: To find the precedence of the arithmetic, comparison, and logical operators. Arithmetic operator:…
Q: Blinking: Fix the below code. Using the display property, create it so that it will flash the…
A: Asked corrected javascript code is provided in the next step.
Q: Draw the flowchart for an application that will request the user to enter the radius of a circle.…
A: The flowchart contains the start Pi value is 3.24 Input radius - Take radius input The formula of…
Q: When the emphasis is on a Button control, what happens if you press Enter
A: This question deals with the emphasis is on a Button control, what happens if you press Enter.
Q: 2. (Temperature Conversion) Write a temperature-conversion application that converts from Fahrenheit…
A: Objective: This program is developed to convert a given temperature from Fahrenheit to Celcius. It…
Q: A- What is the difference between checkbox and option button?
A: In Check box, you can choose various choices. In Option Button (Radio button) you can choose one…
Q: with comments and output screenshot is must. No plagarism please
A: JAVA Code is below:
Q: Which class indicates uppercased text? .text-uppercase .text-capitalize .uppercase .ucase
A: class indicating uppercased text is in step 2.
Q: Design an application called SwingArithmetics as shown below. The "CLEAR" button shal clear all the…
A: Create a Arithmetic application using java swings
Q: Q3: Write a VB.NET code inside Button1_Click. When pressed by the user, it displays a message box as…
A: Here we write simple code to show msgbox.…
Q: When the user types into a TextBox control, the text is stored in the control’s __________ property.…
A: Property used to store text A string is an array of characters that represents words. TextBox…
Q: the decPay variable contains the number 1200.76, which of the following statements displays the…
A: “Since you have asked multiple question, we will solve the first question for you. If you want any…
Q: The graphic functions commonly used to create and print text are described : outtextxy(string) true…
A: Please find the answer below :
Q: Define the use of the following AWT and write the syntax: Button checkboxes radio button…
A: /* A button is basically a control component with a label that generates an event when pushed.*/ /*…
Q: The quiz should contain at least five questions about a hobby, popular music, astronomy, or any…
A: Class declaration for game. check for input. Inputs an array and output questions as a string.…
Q: Programming Challenges 1. Sum of Numbers Create an application that displays a form similar to the…
A: The above code is solved using C#
Q: O 0{ 48% 4G* VodaCom-SA ll 2:3 |_DO_SU1 CMPG 122 User Interface Programming I_Do Chapter 2:…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Write the code that shows a message box with the following details title: your name text: your…
A: string title= "Name"; string message = "your student number"; MessageBoxButtons buttons…
Q: In code, how can you detect whether a RadioButton or a CheckBox control has been selected
A: Using a CheckBox or a RadioButton control in code:
Q: What value will be displayed in the message box when the following code segment is executed? double…
A:
Q: Create an application that converts Celsius to Fahrenheit. The formula is F=1.8×C+32 where F is the…
A: Solution:: The program to convert the Celsius to Fahrenhite is given below. Sub convert() Dim…
Q: In Visual Basic Program, regarding Loops, how many times will the message be displayed in each…
A: Required: In Visual Basic Program, regarding Loops, how many times will the message be displayed in…
Q: Design form in vb contains three command buttons, the first title buttons (Start) and show an input…
A: Actually, program is a executable software that runs on a computer.
Q: boolean exp = (( boolean1 || (! boolean2 ) ) && boolean3 ); Retype it in the input textbox below and…
A: NOT operator has got highest precedence. Then AND operator && has got higher precedence…
Q: difference between Radio button and checkbox
A: In case of radio button group, you can choose only one option whereas in checkbox group you can…
Q: Design a form to order a pizza. This should include: size pizza - drop down. deliver or take out -…
A: I have answered this question in step 2.
Q: There are 3 parts to each question. Please give me the code for all the 3 parts . Any kind of help…
A: Programming language is missing in the question. So we will answer this program in Python. If you…
Q: Textboxes are often used to receive input from the user
A: Textbox The textbox is a graphical control or component that appears in a webpage or application and…
Q: Write pseudo code and design flowchart that performs the following: 1. Ask a user to enter a number.…
A: START INPUT number IF number >= 0 and number < 10 PRINT "blue" ELSE IF number >= 10 and…
Q: Code with comments and output screenshot is must. I will Upvote. Thank you!
A: Required:
Q: Assume that the Boolean variable hot is assigned the value true and the Boolean variable humid is…
A: Answers: B C
Q: 6- final question Assuming you have implemented a mini calculator. MiniCalculator Result Number 1…
A: The problem is based on the basics of working of inbuilt functions of a programming language.
Q: The text box's event is triggered when the contents of the text box change
A: Please find the answer below :
Q: Design a form with a text box in visual basic . Use select statement so that when user enters g, b,…
A: Form with a text box in visual basic Public Class Form123 Private Sub Form123_Load(ByVal sender…
Q: Create a simple login form for your local internet café using conditional statement. Your program…
A: #include<bits/stdc++.h> using namespace std; int main() { string username = "admin",password…
Q: When a control has the __________, it accepts keyboard input from the user.
A: When a control has the ________, it accepts keyboard input from the user.
Q: Write a program in visual basic that calculate the average value of thee integer numbers. Use four…
A: Private Sub Command1_Click() Dim a, b, c As Integer Dim d As Single a = Val(Text1.Text) b =…
Q: To make the PictureBox1 control the same size as the PictureBox2 control, you first select…
A: The “Format” menu in Visual Basic can be used to align, center and make same size the controls on…
Q: what is Default radio button?
A: Introduction of Radio Button: Radio buttons are normally presented in radio groups and only one…
Q: Write the value of H after executing the program, g=6 Private Sub Commandl_Click () Dim g. HAs…
A: Value of g = 6 G will be true after executing instruction four H = 2.75 *g + 1 =2.75 * 6 + 1…
Step by step
Solved in 2 steps
- Look at the following applet code snippet: 1 import javax.swing.*; 2 import java.awt.*; 3 public class GraphicsTest extends JApplet 4 { 5 public void init() 6 { 7 getContentPane().setBackground(Color.WHITE); 8 } 9 public void paint(Graphics g) 10 { 11 int[] xCoords = {20, 20, 60, 100, 140, 140, 100, 60}; 12 int[] ycoords = {20, 100, 140, 140, 100, 60, 20, 20}; 13 super.paint(g); 14 g.setColor(Color.YELLOW); 15 g.fillPolygon(xCoords, yCoords, 8); 16 g.setColor(color.BLACK); 17 g.setFont(new Font("SansSerif", Font.BOLD, 35)); 18 g.drawString("SLOW", 35, 95); 19 } 20 } How many vertices does the polygon have? Justify your answer.The first one is answered as follows. Help with the second one. package test;import javax.swing.*;import java.awt.*;import java.awt.event.*; public class JavaApplication1 { public static void main(String[] arguments) { JFrame.setDefaultLookAndFeelDecorated(true);JFrame frame = new JFrame("print X and Y Coordinates");frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout());frame.setSize(500,400); final JTextField output = new JTextField();;frame.add(output,BorderLayout.SOUTH); frame.addMouseListener(new MouseListener() {public void mousePressed(MouseEvent me) { }public void mouseReleased(MouseEvent me) { }public void mouseEntered(MouseEvent me) { }public void mouseExited(MouseEvent me) { }public void mouseClicked(MouseEvent me) {int x = me.getX();int y = me.getY();output.setText("Coordinate X:" + x + "|| Coordinate Y:" + y);}}); frame.setVisible(true);}}Please fix errors for the java code below. The program is a t square fractal (image below) import javax.swing.*;import java.awt.*;import java.awt.geom.*; //main classpublic class SquareFractal { public static void main(String[] args) { FractalFrame tframe = new FractalFrame(); tframe.setTitle("T Square Fractal"); tframe.setVisible(true); }} //JFrame extended in fractal class class T_Fractal extends JFrame{ private JPanel panel; private int twidth, theight; private int x = 200; private int limit = 15; public T_Fractal() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //default height and width final int Width = 1000; final int Height = 1000; setSize(Width, Height); setLocation(200,50); panel = new JPanel(); Container t_content = getContentPane(); t_content.add(panel, "Center"); } public void paint(Graphics graphics) { super.paint(graphics); Graphics2D g2 = (Graphics2D) graphics; twidth = getWidth(); theight = getHeight();…
- Write this code to get 7 inputs: import javax.swing.*;import java.awt.*;import java.awt.event.*; class WeeMadLib implements ActionListener { JFrame wmlGame = new JFrame("Wee Mad Lib");JPanel gameBoard = new JPanel(new GridLayout(3,3)); JLabel subjectLabel = new JLabel("Subject");JLabel verbLabel = new JLabel("Verb");JLabel objectLabel = new JLabel("Object"); JLabel subject = new JLabel("My friend ");JTextField verb = new JTextField(25);String[] objectOptions = { " a ball."," chickens."," a kazoo.", " an igloo." };JComboBox object = new JComboBox(objectOptions); JButton clear = new JButton("Clear");JTextArea sentence = new JTextArea("My friend ___ ___.");JButton exit = new JButton("Exit"); public WeeMadLib() { wmlGame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); wmlGame.setSize(300,300); subjectLabel.setOpaque(true); subjectLabel.setBackground(new Color(0,255,255)); subjectLabel.setHorizontalAlignment(JLabel.CENTER); sentence.setEditable(false); sentence.setOpaque(false);…DESCRIBE WHAT THE FOLLWING JAVA CODE DOES: public class Main{ public static void main(String[] args) { new MyFrame(); } } import javax.swing.*; public class MyFrame extends JFrame{ MyPanel panel; MyFrame(){ panel = new MyPanel(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(panel); this.pack(); this.setLocationRelativeTo(null); this.setVisible(true); } } import java.awt.*; import javax.swing.*; public class MyPanel extends JPanel{ //Image image; MyPanel(){ //image = new ImageIcon("sky.png").getImage(); this.setPreferredSize(new Dimension(500,500)); } public void paint(Graphics g) { Graphics2D g2D = (Graphics2D) g; //g2D.drawImage(image, 0, 0, null); g2D.setPaint(Color.blue); g2D.setStroke(new BasicStroke(5)); g2D.drawLine(0, 0, 500, 500); //g2D.setPaint(Color.pink); //g2D.drawRect(0, 0, 100, 200); //g2D.fillRect(0, 0, 100, 200); //g2D.setPaint(Color.orange); //g2D.drawOval(0, 0, 100, 100); //g2D.fillOval(0, 0, 100, 100); //g2D.setPaint(Color.red); //g2D.drawArc(0, 0,…Please help me fix this java code which is supposed to be a Pac-Man game Java program is below import java.awt.*; import javax.swing.JFrame.*; public class ManyPacMans extends JFrame { public void paint(Graphics g) { g.drawghostShape(60,30,40); setBackground(Color.BLUE); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.PINK); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.RED); g.fillghostShape(130, 30,100, 80); g.drawOvalpacman(30,130,50, 60); setForeground(Color.yellow); g.fillOval(130,130,50, 60); } public Ghost(String imgPath, int x, int y, int speed, boolean ip) { super(imgPath, new int[] {0,0}, GHOST_WIDTH, GHOST_HEIGHT, GHOST_FRAMERATE, x, y); super.addFramesForAnimation("scatter", "ghost_scatter.png", 0, 0, 22,0); super.speed = speed; startX = x; startY = y; scoreValue = 200; } public ManyPacMans() { initUI(); } private void initUI() { add(new…
- Please add a line(s) of code to the java code below. And comment the java code. Refer to image below and show output of the sierpenski triangle import java.awt.Color;import java.awt.Graphics;import javax.swing.JFrame; public class SierpinskiTriangle extends JFrame { public SierpinskiTriangle() { setTitle("Sierpinski Triangle"); setSize(1000,1000); setVisible(true); setDefaultCloseOperation(EXIT_ON_CLOSE); } public void paint(Graphics g) { g.setColor(Color.BLUE); sierpinski(g, 500, 250, 500); } public void sierpinski(Graphics g, int x1, int y1, int side) { int x2 = x1 + side; int x3 = x1 + side / 2; int y2 = y1 - (int) (Math.sqrt(3.0) / 2.0 * side); int y3 = y1 + (int) (Math.sqrt(3.0) / 2.0 * side); if (side < 10) { g.drawLine(x1, y1, x2, y1); g.drawLine(x2, y1, x3, y2); g.drawLine(x3, y2, x1, y1); } else { sierpinski(g, x1, y1, side / 2);…DEUGGING PROBLEM // Prompts user for a size using Scanner // Creates a frame with the specified size // that is twice as tall as wide import javax.swing.*; import java.util.*; public class DebugFourteen1 extends JFrame { public DebugFourteen1(int size) { super("This is my frame"); setSize(size, size + 2); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String[] args) { Scanner kb = new Scanner(System.in); int size; System.out.print("Enter width for frame >> "); size = kb.nextLine(); DebugFourteen1 frame = new DebugFourteen1(size); frame.setVisible(); } }import java.awt.*;public class TestRandomWalker {public static final int STEPS = 500;public static void main(String[] args) {RandomWalker walker = new RandomWalker(); // instantiate Walker objectDrawingPanel panel = new DrawingPanel(500, 500);Graphics g = panel.getGraphics();// advanced features -- center and zoom in the imagepanel.getGraphics().translate(250, 250);panel.getGraphics().scale(4, 4);// make the walker walk, and draw its movementint prevX = walker.getX(); // initialize Walker displayint prevY = walker.getY();for (int i = 1; i <= STEPS; i++) {g.setColor(Color.BLACK);g.drawLine(prevX, prevY, walker.getX(), walker.getY()); // update Walker display walker.move(); // move Walker 1 stepprevX = walker.getX(); // update x valueprevY = walker.getY(); // update y valueg.setColor(Color.RED); g.drawLine(prevX, prevY, walker.getX(), walker.getY()); // update Walker display int steps = walker.getSteps(); // record Walker stepsif (steps % 10 == 0) {System.out.println(steps + "…
- import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.text.DecimalFormat; public class GPACalculator extends JFrame{private JLabel gradeL, unitsL, emptyL; private JTextField gradeTF, unitsTF; private JButton addB, gpaB, resetB, exitB; private AddButtonHandler abHandler;private GPAButtonHandler cbHandler;private ResetButtonHandler rbHandler;private ExitButtonHandler ebHandler; private static final int WIDTH = 400;private static final int HEIGHT = 150; private static double totalUnits = 0.0; // total units takenprivate static double gradePoints = 0.0; // total grade points from those unitsprivate static double totalGPA = 0.0; // total GPA (gradePoints / totalUnits) //Constructorpublic GPACalculator(){//Create labelsgradeL = new JLabel("Enter your grade: ", SwingConstants.RIGHT);unitsL = new JLabel("Enter number of units: ", SwingConstants.RIGHT);emptyL = new JLabel("",SwingConstants.RIGHT); //Create text fieldsgradeTF = new JTextField(10);unitsTF = new…Please do not give solution in image format thanku packagecom.abc.base; public class MyDataTypes { public static void main(String[] args) { int a=10; int b=20; System.out.println("a="+a); System.out.println("b="+b); } } //swap the value between a and b without creating any third varialbe.please build up the java codecomplete the code and fill up missing codes// = needs input for the code thank you import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.ArrayList; public class GUI extends JFrame implements ActionListener {JMenuItem resetItem, startItem;JTextField ansTextField;JLabel resultLabel, scoreLabel, timeLabel, operationLabel;Timer timer;DoubleDigitOp op;final int maxTime = 6;final int runTime = 100;double score = 0;int newTime = maxTime*runTime;String[] status = new String[]{"Score: ","Timer: "};String[] reset = new String[]{"Score: 0.00","Timer: "+((double)newTime/100),"00 + 00 = ","Game Message"};public GUI(String title){setTitle(title);//Create a Menu names "Game" (1) //Add two menus on "Game": the menus named "Start" and "Reset" (6) -- both execute an actionJMenuBar menuBar = new JMenuBar();menuBar.add(gameMenu);setJMenuBar(menuBar);JPanel content = new JPanel();content.setLayout(new BorderLayout());JPanel statusPanel = new…