Skip to content

Instantly share code, notes, and snippets.

View L8RFN's full-sized avatar
💭
Busy.

Qusai Bin Elayyan L8RFN

💭
Busy.
  • Middle East
  • 00:48 (UTC +03:00)
View GitHub Profile
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame {
JPanel left = new JPanel(new GridLayout(3,2,5,5));
JPanel right = new JPanel(new GridLayout(8,1));
JRadioButton boxes [] = new JRadioButton[6];
String country [] = {"Jordan", "Palestine", "Egypt", "Algeria", "Saudi Arabia", "Mauritania" };
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame{
JLabel unit= new JLabel("calculator");
JTextField input = new JTextField("Enter the number you want to convert it.");
JTextField output = new JTextField("the result will be displayed here.");
String units [] ={"centimeter","meter"};
@L8RFN
L8RFN / calc.java
Last active January 6, 2024 05:20
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame implements ActionListener {
JButton numbers [] = new JButton[12];
JTextField up;
JPanel num;
int sum;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame implements ActionListener {
JButton[] buttons = new JButton[9];
int counter = 0;
String currentPlayer = "X";
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame implements ActionListener{
JPanel left, topRight, bottomLeft;
JLabel dollar, can;
JTextField dolNum,canNum;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI extends JFrame implements ActionListener {
JButton numbers [] = new JButton[12];
JTextField up;
JPanel num;
int sum;
}
public void insertToHead(int val){
if(isEmpty()){
head= new node();
head.data=val;
head.next=null;
tail=head;
}
else{
node nn= new nod
class node {
int data;
node next;
}
class Slist {
static node head;
node tail;
int count;
public Slist(){
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the size of the array to sort: ");
int size = sc.nextInt();
sc.close();
//q1
Question#1 (Constructors):
1. Create a class called Rectangle that contains the following data fields:
• height as integer.
• width as integer.
2. The class also contains the following methods:
• A no-arguments constructor that initializes Rectangle data fields to their default values.
• A two-arguments constructor that initializes Rectangle data fields to specific given values.
• A method named getArea() that returns the area of the rectangle.
3. In the main method: