In the field create:
Two Font objects. Call them nameFont and dateFont. Set them to whatever name, style, and size that you wish. Just make sure they are different.
Two Color objects. Call them nameColor and dateColor. In one use the whole number constructor to create a custom color for your name. In the other use the constructor that takes floating point numbers as percentages to create a color for the date.
An instance of the content pane so that you can add components to it.
Create three JLabels one called lblFName which has your first name in it, one called lblLName that has your last name in it, and one called lblDate that has the date in it.
Create a constructor that will allow you to initialize your application. In it:
Set the application to visible, the size to 300, 300, the title to "First GUI App", and the default close operation to EXIT_ON_CLOSE
Set the layout of the content pane to a GridLayout that is 3 rows by 1 column.
Set the text color and Font to the JLabels that hold you name and date using the Font and Color objects you created.
Add the JLabels to the content pane. In the order of, First Name, Last Name, Date.
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class GuiApp
{
public static void main(String args[])
{
GuiApp g=new GuiApp();
}
GuiApp()
{
JFrame jframe;
JPanel anchor;
jframe = new JFrame("First GUI App");
anchor = new JPanel();
Font nameFont=new Font("Serif", Font.PLAIN, 15);
Font dateFont=new Font("Serif", Font.ITALIC, 25);
Color nameColor=new Color(85,45,55);
Color dateColor=new Color((float)0.3,(float)0.5,(float)0.4);
JLabel lblFName =new JLabel("firstname");
JLabel lblLName =new JLabel("lastname");
JLabel lblDate =new JLabel("Date");
lblDate.setFont(dateFont);
lblDate.setForeground(nameColor);
lblFName.setFont(nameFont);
lblFName.setForeground(nameColor);
lblLName.setFont(nameFont);
lblLName.setForeground(nameColor);
anchor.setLayout(new GridLayout(3,1));
anchor.add(lblLName);
anchor.add(lblFName);
anchor.add(lblDate);
jframe.setContentPane(anchor);
jframe.setSize(300, 300);
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setVisible(true);
}
}
--------------------
In the field create: Two Font objects. Call them nameFont and dateFont. Set them to whatever...
Java FX Application Purpose The purpose of this assignment is to get you familiar with the basics of the JavaFX GUI interface components. This assignment will cover Labels, Fonts, Basic Images, and Layouts. You will use a StackPane and a BorderPane to construct the layout to the right. In addition you will use the Random class to randomly load an image when the application loads Introduction The application sets the root layout to a BorderPane. The BorderPane can be divided...
Question 2: Your task is to create a GUI application that allows a user to create a group of Hero objects s (think Lord of the Your group may be a small band of two or three Heroes or it may consist of Rines or the Marvel Cinenatic Universe here) You have been given the compiled version of the dlass encapsulating a Hero and you have also been given the specification. Your job is to create a GUI application that...
JavaFX! Just need to fill several lanes of code please!!! CSE205 OOP and Data Structure Quiz #15 Last Name (print) First Name (print) Write a JavaFX GUI application program that simulates a timer. The timer should show "count: the beginning and increase the number by 1 in every one second, and so on. o" at .3 A Timer - × A Timer Count: 0 Count: 1 (B) After 1 second, the GUI Window (A) Initial GUI Window According to the...
Create a class called Flower. Add one member variables Color. Add only one getter function for the color. The get function returns color. Implement a constructor that expects color value and assigns it to the member variable. Create a subclass of Flower named Rose. The Rose class has one member variable name. Add a constructor which expects color and name. Pass color to the base constructor and set name to it's member variable.Write a program that has an array of...
Animal classes and create instances of them. In the main method do the following: Create a Farm of size 10 Create 5 Animal Objects with the details specified in the table below Add the 5 Animal objects to the Farm Call the printDetails method from the Farm to print all the Farm and Animal details. variable name name birthYear weight gender a1 a2 a3 a4 a5 cOw 2012 1000.5 f pig 2009 550.5 m donkey 1999 773.42 m sheep 2016...
Your assignment is to create and test a class for a queue of objects. You may use any object class of your choice as the data for the queue. The instances of the class should have at least one field that distinguishes each instance from other instances of the class (key property, also called a key field). You should complete the software to implement and test your queue and submit the software along with a project report. Your queue class...
Programming: Create a class called City with two public variables: a string to store the name of the city and a float to store the average temperature in Fahrenheit. Create one object of the class that you create and ask the user to enter the city name and the average temperature in Fahrenheit. Store these in the object of the class that you create. Then display the contents of the class. Once that is working, make the variables private and...
Array lists are objects that, like arrays, provide you the ability to store items sequentially and recall items by index. Working with array lists involves invoking ArrayList methods, so we will need to develop some basic skills. Let's start with the code below: The main method imports java.utii.ArrayList and creates an ArrayList that can hold strings by using the new command along with the ArrayList default constructor. It also prints out the ArrayList and, when it does, we see that...
Java Painter Class This is the class that will contain main. Main will create a new Painter object - and this is the only thing it will do. Most of the work is done in Painter’s constructor. The Painter class should extend JFrame in its constructor. Recall that you will want to set its size and the default close operation. You will also want to create an overall holder JPanel to add the various components to. It is this JPanel that...
Please try to write the code with Project 1,2 and 3 in mind. And use java language, thank you very much. Create an Edit Menu in your GUI Add a second menu to the GUI called Edit which will have one menu item called Search. Clicking on search should prompt the user using a JOptionPane input dialog to enter a car make. The GUI should then display only cars of that make. You will need to write a second menu...