a gui java code 1

Relax! Stop worrying about deadlines and let our professional writers help you. Hire an essay writer helper and receive a professional assignment before your deadline. We provide writing services for all types of academic assignments.


Order a Similar Paper Order a Different Paper

I have this program, ((enter a bunch of integers in any order, and the buttons find the minimum and maximum of the integers, interactively.)) as this pic shows

the code is provided and all the job is ::

1- crate project and name it:: mm_al . Then, create a package and name it:: com.ra_al.mm. Then, create a class and name it: mm_al.
2- edit the code ( if it necessary) and run it in IntelliJ ide.
3- zip the project file..

import java.awt.Container;
import javax.swing.JFrame;



public class MnMaxPanel
{
public MnMaxPanel() {}

public static void main(String[] args)
{
JFrame frame = new JFrame("MinMax Finder");
frame.setDefaultCloseOperation(3);

frame.getContentPane().add(new MinMax());

frame.pack();
frame.setVisible(true);
}
}_x000D_ _x000D_


import java.awt.event.ActionEvent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class MinMax extends javax.swing.JPanel
{
public static int counter;
private JTextField theInt;
private JButton minInt;
private JButton maxInt;
private JLabel infoLabel;
private JLabel maxLabel;
private JLabel minLabel;
private JLabel blank0;
private JLabel blank1;
static int[] aRay = new int[20];

public MinMax()
{
minInt = new JButton("Minimum");
minInt.addActionListener(new minButtonListener(null));

maxInt = new JButton("Maximum");
maxInt.addActionListener(new maxButtonListener(null));

theInt = new JTextField(5);
theInt.addActionListener(new textListener(null));

infoLabel = new JLabel("The integers you enter will show up here");
minLabel = new JLabel(" The Minimum is: ");
maxLabel = new JLabel(" The Maximum is: ");






add(minInt);
add(theInt);
add(maxInt);


add(infoLabel);

add(minLabel);

add(maxLabel);


setPreferredSize(new java.awt.Dimension(300, 100));
setBackground(java.awt.Color.cyan);
}

private void printAray() {
for (int i = 0; i < counter; i++) {
System.out.println(aRay[i]);
}
}

private int findMin() {
int min = aRay[0];
for (int i = 0; i < counter; i++) {
if (aRay[i] < min)
min = aRay[i];
}
return min;
}

private int findMax()
{
int max = aRay[0];
for (int i = 0; i < counter; i++) {
if (aRay[i] > max)
max = aRay[i];
}
return max;
}

private class minButtonListener implements java.awt.event.ActionListener { private minButtonListener() {}

public void actionPerformed(ActionEvent event) { minLabel.setText(" Minimum is " + MinMax.this.findMin()); }
}

private class maxButtonListener
implements java.awt.event.ActionListener {
private maxButtonListener() {}

public void actionPerformed(ActionEvent event) { maxLabel.setText(" Maximum is " + MinMax.this.findMax()); }
}

private class textListener implements java.awt.event.ActionListener {
private textListener() {}

public void actionPerformed(ActionEvent event) {
int anInt = Integer.parseInt(theInt.getText());

theInt.setText(Integer.toString(0));
infoLabel.setText(" You entered " + anInt + " ");
MinMax.aRay[MinMax.counter] = anInt;
MinMax.counter += 1;
}
}
}

Great students hand in great papers. Order our essay service if you want to meet all the deadlines on time and get top grades. Professional custom writing is the choice of goal-focused students. Word on the online streets is... we're simply the best!

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper