I have done it under neatbeans IDE and just added ToggleGroup for grouping radion buttons
inorder to select one at time.
package tempconverter;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Tempconverter extends Application {
/**
* @param args the command line arguments executes project
*/
final ToggleGroup group1 = new ToggleGroup();
final ToggleGroup group2 = new ToggleGroup();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane pane = new BorderPane(); //the big picture
BorderPane p1 = new BorderPane();//top
BorderPane p2 = new BorderPane(); //bottom
Label temp = new Label(\"Enter a temperature\"); //enter temp label
Label convertTemp = new Label(\"Converted temperature\"); //converted temp label
Label input = new Label(\"Input Scale\");//input scale label
Label output = new Label(\"Output Scale\");//Output Scale label
TextField tempText = new TextField(); //text field to enter temp
TextField convertText = new TextField(); //output textfield for the converted temp
VBox scaleIn = new VBox(15);
VBox scaleOut = new VBox(15);
RadioButton c = new RadioButton(\"celcius\"); //button for celcius on input side
c.setToggleGroup(group1);
RadioButton f = new RadioButton(\"Fahrenheit\");//button for Fahrenheit on input side
f.setToggleGroup(group1);
RadioButton k = new RadioButton(\"kelvin\");//button for kelvin on inputside
k.setToggleGroup(group1);
RadioButton c1 = new RadioButton(\"celcius\");//button for celcius on outputside
c1.setToggleGroup(group2);
RadioButton f1 = new RadioButton(\"Fahrenheit\"); //button for f on output side
f1.setToggleGroup(group2);
RadioButton k1 = new RadioButton(\"kelvin\"); //button for kelvin on output side
k1.setToggleGroup(group2);
p1.setStyle(\"-fx-border-color:red\"); //set top border pane to red
p1.setRight(tempText);
p1.setLeft(temp);
pane.setTop(p1);
pane.setBottom(p2);
p2.setLeft(convertTemp);
p2.setRight(convertText);
p2.setStyle(\"-fx-border-color:red\");
input.setPrefWidth(100);
output.setPrefWidth(100);
c.setPrefWidth(100);
f.setPrefWidth(100);
k.setPrefWidth(100);
c1.setPrefWidth(100);
f1.setPrefWidth(100);
k1.setPrefWidth(100);
scaleIn.setStyle(\"-fx-border-color:red\");
scaleIn.getChildren().addAll(input, c, f, k);
scaleIn.setAlignment(Pos.CENTER);
pane.setLeft(scaleIn);
TextArea.
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!JSFestUA
The React team has been working hard on changing the game of writing declarative components: Hooks! With React Hooks we are now able to use the capabilities of class components in functional components. In this talk we are going to discover the Hooks API and explore some exciting patterns using them.
package chapter15;
import javafx.application.Application;
import javafx.beans.property.DoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
/**
* Java Programming: Comprehensive (10e); Liang; Pearson 2014
*
* *15.21(Drag points) Draw a circle with three random points on the circle. Connect
* the points to form a triangle. Display the angles in the triangle. Use the mouse
* to drag a point along the perimeter of the circle. As you drag it, the triangle and
* angles are redisplayed dynamically, as shown in Figure 15.30b. For computing
* angles in a triangle, see Listing 4.1.
*
* {@code A = Math.acos((a * a - b * b - c * c) / (-2 * b * c))}
* {@code B = Math.acos((b * b - a * a - c * c) / (-2 * a * c))}
* {@code C = Math.acos((c * c - b * b - a * a) / (-2 * a * b))}
*
* @author ncoop
*/
@SuppressWarnings(\"WeakerAccess\")
public class DragPoints extends Application {
@Override
public void start(Stage primaryStage) {
final PointPane pane = new PointPane(640, 480);
pane.setStyle(\"-fx-background-color: wheat;\");
Label label = new Label(\"Click and drag the points.\");
BorderPane borderPane = new BorderPane(pane);
BorderPane.setAlignment(label, Pos.CENTER);
label.setPadding(new Insets(5));
borderPane.setBottom(label);
Scene scene = new Scene(borderPane);
primaryStage.setTitle(\"Exercise15_21\");
primaryStage.setScene(scene);
primaryStage.show();
}
private class PointPane extends Pane {
final Circle circle = new Circle();
final Vertex[] v = new Vertex[3];
final int strokeWidth = 2;
final Color circleStroke = Color.GRAY, legStroke = Color.BLACK;
@SuppressWarnings(\"SameParameterValue\")
PointPane(double w, double h) {
this.setPrefSize(w, h);
this.setWidth(w);
this.setHeight(h);
circle.setStroke(circleStroke);
circle.setFill(Color.TRANSPARENT);
circle.setStrokeWidth(strokeWidth);
circle.radiusProperty().bind(this.heightProperty().multiply(0.4));
circle.centerXProperty().bind(this.widthProperty().divide(2));
circle.centerYProperty().bind(this.heightProperty().divide(2));
this.getChildren().add(circle);
// create the vertices at random angles
for (int i = 0; i < v.length; i++) {
v[i] = new Vertex(circle, 2 * Math.PI / v.length * (i + Math.random()));
v[i].radiusProperty().bind(circle.radiusProperty().divide(10));
v[i].setPosition();
v[i].setStroke(new Color(i == 0 ? 1 : 0, i == 1 ? 1 : 0, i == 2 ? 1 : 0, 1));
v[i].setFill(Color.TRANSPARENT);
v[i].setStrokeWidth(strokeWidth);
this.getChildren().add(v[i]);
v[i].setOnMouseDr.
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!JSFestUA
The React team has been working hard on changing the game of writing declarative components: Hooks! With React Hooks we are now able to use the capabilities of class components in functional components. In this talk we are going to discover the Hooks API and explore some exciting patterns using them.
package chapter15;
import javafx.application.Application;
import javafx.beans.property.DoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
/**
* Java Programming: Comprehensive (10e); Liang; Pearson 2014
*
* *15.21(Drag points) Draw a circle with three random points on the circle. Connect
* the points to form a triangle. Display the angles in the triangle. Use the mouse
* to drag a point along the perimeter of the circle. As you drag it, the triangle and
* angles are redisplayed dynamically, as shown in Figure 15.30b. For computing
* angles in a triangle, see Listing 4.1.
*
* {@code A = Math.acos((a * a - b * b - c * c) / (-2 * b * c))}
* {@code B = Math.acos((b * b - a * a - c * c) / (-2 * a * c))}
* {@code C = Math.acos((c * c - b * b - a * a) / (-2 * a * b))}
*
* @author ncoop
*/
@SuppressWarnings(\"WeakerAccess\")
public class DragPoints extends Application {
@Override
public void start(Stage primaryStage) {
final PointPane pane = new PointPane(640, 480);
pane.setStyle(\"-fx-background-color: wheat;\");
Label label = new Label(\"Click and drag the points.\");
BorderPane borderPane = new BorderPane(pane);
BorderPane.setAlignment(label, Pos.CENTER);
label.setPadding(new Insets(5));
borderPane.setBottom(label);
Scene scene = new Scene(borderPane);
primaryStage.setTitle(\"Exercise15_21\");
primaryStage.setScene(scene);
primaryStage.show();
}
private class PointPane extends Pane {
final Circle circle = new Circle();
final Vertex[] v = new Vertex[3];
final int strokeWidth = 2;
final Color circleStroke = Color.GRAY, legStroke = Color.BLACK;
@SuppressWarnings(\"SameParameterValue\")
PointPane(double w, double h) {
this.setPrefSize(w, h);
this.setWidth(w);
this.setHeight(h);
circle.setStroke(circleStroke);
circle.setFill(Color.TRANSPARENT);
circle.setStrokeWidth(strokeWidth);
circle.radiusProperty().bind(this.heightProperty().multiply(0.4));
circle.centerXProperty().bind(this.widthProperty().divide(2));
circle.centerYProperty().bind(this.heightProperty().divide(2));
this.getChildren().add(circle);
// create the vertices at random angles
for (int i = 0; i < v.length; i++) {
v[i] = new Vertex(circle, 2 * Math.PI / v.length * (i + Math.random()));
v[i].radiusProperty().bind(circle.radiusProperty().divide(10));
v[i].setPosition();
v[i].setStroke(new Color(i == 0 ? 1 : 0, i == 1 ? 1 : 0, i == 2 ? 1 : 0, 1));
v[i].setFill(Color.TRANSPARENT);
v[i].setStrokeWidth(strokeWidth);
this.getChildren().add(v[i]);
v[i].setOnMouseDr.
Please help!!I wanted to know how to add a high score to this prog.pdfJUSTSTYLISH3B2MOHALI
Please help!!
I wanted to know how to add a high score to this program and wanted to add how many times
you press the spacebar
import javax.swing.*;
import java.awt.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Renderer extends JPanel{
//private static final long serialVersionUID = 1L;
protected void paintComponent(Graphics g) {
Main.main.repaint(g);
}
public static int clamp(int greenValue, int i, int j) {
// TODO Auto-generated method stub
return 0;
}
}
OTHER PART:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Main implements ActionListener, KeyListener{
public static Main main;
public final int WIDTH = 1400;
public final int HEIGHT = 600;
public HUD Hud;
public Renderer renderer;
public Rectangle character;
public ArrayList cloud;
public Random rand;
public boolean start = false, gameover = false;
public int tick;
public Main() {
JFrame jFrame = new JFrame();
Timer timer = new Timer(20, this);
renderer = new Renderer();
rand = new Random();
jFrame.setTitle(\"Example\");
jFrame.add(renderer);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setSize(WIDTH, HEIGHT);
jFrame.addKeyListener(this);
jFrame.setVisible(true);
cloud = new ArrayList();
character = new Rectangle(200, 220, 20, 20);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
timer.start();
}
public void repaint(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0, WIDTH, HEIGHT);
g.setColor(Color.blue);
g.fillRect(0, HEIGHT - 100, WIDTH, 100);
g.setColor(Color.green);
g.fillRect(character.x, character.y, character.width, character.height);
if (character.y >= HEIGHT - 100 || character.y < 0) {
gameover = true;
}
for (Rectangle rect : cloud) {
g.setColor(Color.white);
g.fillRect(rect.x, rect.y, rect.width, rect.height);
}
g.setColor(Color.WHITE);
g.setFont(new Font(\"Times New Roman\", 1 ,100));
if (!start) {
g.drawString(\"Press to start!\", 450, HEIGHT / 2);
}
else if (gameover) {
g.drawString(\"Game Over!\", 450, HEIGHT / 2);
}
}
public void addCloud(boolean start) {
int width = 400;
int height = 200;
if (start) {
cloud.add(new Rectangle(WIDTH + width + cloud.size() * 300, rand.nextInt(HEIGHT-120),
80, 100));
}
else {
cloud.add(new Rectangle(cloud.get(cloud.size() - 1).x + 300, rand.nextInt(HEIGHT-120), 80,
100));
}
}
public void flap() {
if (gameover) {
character = new Rectangle(300, 400, 40, 40);
cloud.clear();
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
gameover = false;
}
if (!start) {
start = true;
}
else if (!gameover) {
character.y -= 70;
tick = 0;
}
}
@Override
public void actionPerformed(ActionEvent e) {
int speed = 15;
//System.out.println(\"Space.
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
In Java Write a GUI application to simulate writing out a check. The value of a check can be
between 0 – 999,999,999,999.99. Your application will accept a name and a value. And display
it on a check. As a minimum you will display the following information: Bank name Pay to the
order of Amount in words Comma separate amount. Your GUI does not have to be exactly as
shown but must have the information indicated above.
Solution
Class cheque is used to enter values
public class Cheque extends javax.swing.JFrame {
public Cheque() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText(\"Name\");
jLabel2.setText(\"Amount\");
jButton1.setText(\"Submit\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setText(\"Enter Values\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
206, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(32, 32, 32)))
.addContainerGap(7, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addCo.
Higher Order Components and Render PropsNitish Phanse
Talk given at React foo Hyderabad 2018. Outlines the differences between higher order components and render props. Both being design patterns used primarily to aid reusability of components across a codebase.
I am getting a syntax error. I cant seem to find whats causing t.pdffashionfolionr
I am getting a syntax error. I can\'t seem to find what\'s causing this progrm even though I correct
what it\'s asking me to do. It seems to add even more errors.
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class GUI extends JFrame {
// create required GUI radios, labels, textfields and buttons
private JRadioButton iterative;
private JRadioButton recursive;
private JLabel entern;
private JLabel result;
private JLabel efficiency;
private JTextField t1;
private JTextField t2;
private JTextField t3;
private JButton compute;
private ButtonGroup radios = new ButtonGroup();
private ButtonGroup candidates = new ButtonGroup();
// create constructor for GUI
public GUI(){
super(\"Project 3\");
setLayout (new GridLayout(6,2));
setSize(275,250);
// initializing buttons and etc and adding them
iterative = new JRadioButton(\"Iterative\");
add(iterative);
recursive = new JRadioButton(\"Recursive\");
add(recursive);
// add radiobuttons to group so only one selection is possible
radios.add(iterative);
radios.add(recursive);
entern = new JLabel(\"Enter n:\");
add(entern);
result = new JLabel(\"Result:\");
add(result);
efficiency = new JLabel(\"Efficiency:\");
add(efficiency);
t1 = new JTextField();
add(t1);
compute = new JButton(\"Compute\");
add(compute);
t2 = new JTextField();
add(t2);
t3 = new JTextField();
add(t3);
/*
thehandler handler = new thehandler();
iterative.addActionListener(handler);
recursive.addActionListener(handler);
compute.addActionListener(handler);
****************************/
compute.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent b){
computeactionPerformed(b);
private void computeactionPerformed(ActionEvent b){
if ((iterative.isSelected(true))){
JOptionPane.showMessageDialog(null,\"you chose iterative\");
}
else if (recursive.isSelected(true)){
JOptionPane.showMessageDialog(null,\"you chose recursive\");
}
}
}
});
// create sub-panel for radio buttons
JPanel radioPanel = new JPanel();
radioPanel.add(iterative);
radioPanel.add(recursive);
/*
class thehandler implements ActionListener{
public void actionPerformed(ActionEvent e) {
if(e.getSource()==iterative && e.getSource()==compute){
System.out.println(\"you chose iterative\");
}
else if(e.getSource()==recursive && e.getSource()==compute){
System.out.println(\"you chose recursive\");
}
}
}
******************************/
}
public static void main(String[]args){
GUI object = new GUI();
object.setVisible(true);
object.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Solution
I have Change in code . No it\'s working without any compliantion error.
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.
Write a Java class to represent a temperature. The class has a single.pdffootwearpark
Write a Java class to represent a temperature. The class has a single data field: temperatureC
The class has a single constructor that accepts an initial temperature provided as a double
argument If this argument it
Solution
import java.util.Scanner;
public class Temperature {
double setC;
Temperature (double setC){
this.setC = setC;
}
double getC()
{
return setC;
}
public double getF()
{
return ((double)9.0/5.0 * (setC + 32)); // Fahrenheit calculation
}
public double getK()
{
return ((double)setC + 273.15);
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.print(\"Please enter the initial temperature: \");
double setC = sc.nextDouble();
Temperature temp = new Temperature (setC);
System.out.println(\"The current temperature in Celsius is: \" +temp.getC());
System.out.println(\"The current temperature in Fahrenheit is: \" +temp.getF());
System.out.println(\"The current temperature in Kelvin is: \" +temp.getK());
}
}
example:
Please enter the initial temperature: 23 The current temperature in Celsius is: 23.0 The current
temperature in Fahrenheit is: 99.0 The current temperature in Kelvin is: 296.15.
Monadic Comprehensions and Functional Composition with Query ExpressionsChris Eargle
Build monads using the C# language with a C# style, then use the appropriate methods to ensure the LINQ query syntax works with this functional design pattern. After describing monads, we will cut the middleman and apply the same techniques directly to objects and functions to achieve better results with a declarative syntax.
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxmary772
CodeZip/ButtonDemo.javaCodeZip/ButtonDemo.java// Demonstrate a push button and handle action events.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassButtonDemoimplementsActionListener{
JLabel jlab;
JTextField jtf;
ButtonDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("A Button Example");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(220,90);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Make two buttons.
JButton jbtnUp =newJButton("Up");
JButton jbtnDown =newJButton("Down");
// Create a text field.
jtf =newJTextField(10);
// Add action listeners.
jbtnUp.addActionListener(this);
jbtnDown.addActionListener(this);
// Add the buttons to the content pane.
jfrm.add(jbtnUp);
jfrm.add(jbtnDown);
jfrm.add(jtf);
// Create a label.
jlab =newJLabel("Press a button.");
// Add the label to the frame.
jfrm.add(jlab);
// Display the frame.
jfrm.setVisible(true);
}
// Handle button events.
publicvoid actionPerformed(ActionEvent ae){
if(ae.getActionCommand().equals("Up")){
jlab.setText("You pressed Up.");
FileClock clock1=newFileClock(jtf);
Thread thread1=newThread(clock1);
thread1.start();
}
else
jlab.setText("You pressed down. ");
}
publicstaticvoid main(String args[]){
// Create the frame on the event dispatching thread.
SwingUtilities.invokeLater(newRunnable(){
publicvoid run(){
newButtonDemo();
}
});
}
}
CodeZip/CBDemo.javaCodeZip/CBDemo.java// Demonstrate check boxes.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassCBDemoimplementsItemListener{
JLabel jlabSelected;
JLabel jlabChanged;
JCheckBox jcbAlpha;
JCheckBox jcbBeta;
JCheckBox jcbGamma;
CBDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("Demonstrate Check Boxes");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(280,120);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create empty labels.
jlabSelected =newJLabel("");
jlabChanged =newJLabel("");
// Make check boxes.
jcbAlpha =newJCheckBox("Alpha");
jcbBeta =newJCheckBox("Beta");
jcbGamma =newJCheckBox("Gamma");
// Events generated by the check boxes
// are handled in common by the itemStateChanged()
// method implemented by CBDemo.
jcbAlpha.addItemListener(this);
jcbBeta.addItemListener(this);
jcbGamma.addItemListener(this);
// Add checkboxes and labels to the content pane.
jfrm.add(jcbAlpha);
jfrm.add(jcbBeta);
jfrm.add(jcbGamma);
jfrm.add(jlabChanged);
jfrm.add(jlabSelected);
// Display the frame.
jfrm.setVisible(true);
}
// This is the handler for the check boxes..
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxmccormicknadine86
CodeZip/ButtonDemo.javaCodeZip/ButtonDemo.java// Demonstrate a push button and handle action events.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassButtonDemoimplementsActionListener{
JLabel jlab;
JTextField jtf;
ButtonDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("A Button Example");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(220,90);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Make two buttons.
JButton jbtnUp =newJButton("Up");
JButton jbtnDown =newJButton("Down");
// Create a text field.
jtf =newJTextField(10);
// Add action listeners.
jbtnUp.addActionListener(this);
jbtnDown.addActionListener(this);
// Add the buttons to the content pane.
jfrm.add(jbtnUp);
jfrm.add(jbtnDown);
jfrm.add(jtf);
// Create a label.
jlab =newJLabel("Press a button.");
// Add the label to the frame.
jfrm.add(jlab);
// Display the frame.
jfrm.setVisible(true);
}
// Handle button events.
publicvoid actionPerformed(ActionEvent ae){
if(ae.getActionCommand().equals("Up")){
jlab.setText("You pressed Up.");
FileClock clock1=newFileClock(jtf);
Thread thread1=newThread(clock1);
thread1.start();
}
else
jlab.setText("You pressed down. ");
}
publicstaticvoid main(String args[]){
// Create the frame on the event dispatching thread.
SwingUtilities.invokeLater(newRunnable(){
publicvoid run(){
newButtonDemo();
}
});
}
}
CodeZip/CBDemo.javaCodeZip/CBDemo.java// Demonstrate check boxes.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassCBDemoimplementsItemListener{
JLabel jlabSelected;
JLabel jlabChanged;
JCheckBox jcbAlpha;
JCheckBox jcbBeta;
JCheckBox jcbGamma;
CBDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("Demonstrate Check Boxes");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(280,120);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create empty labels.
jlabSelected =newJLabel("");
jlabChanged =newJLabel("");
// Make check boxes.
jcbAlpha =newJCheckBox("Alpha");
jcbBeta =newJCheckBox("Beta");
jcbGamma =newJCheckBox("Gamma");
// Events generated by the check boxes
// are handled in common by the itemStateChanged()
// method implemented by CBDemo.
jcbAlpha.addItemListener(this);
jcbBeta.addItemListener(this);
jcbGamma.addItemListener(this);
// Add checkboxes and labels to the content pane.
jfrm.add(jcbAlpha);
jfrm.add(jcbBeta);
jfrm.add(jcbGamma);
jfrm.add(jlabChanged);
jfrm.add(jlabSelected);
// Display the frame.
jfrm.setVisible(true);
}
// This is the handler for the check boxes. ...
The equation you should use is just a variation of the PV formula.pdfannaimobiles
The equation you should use is just a variation of the PV formula:
r = (FV/PV)1/t -1
r = ($3.20/$1.50)1/5 - 1
=
Solution
The equation you should use is just a variation of the PV formula:
r = (FV/PV)1/t -1
r = ($3.20/$1.50)1/5 - 1
=.
True short double stranded mRNA are involved in initiating the inte.pdfannaimobiles
True: short double stranded mRNA are involved in initiating the interference Answer: C: genes
are reshuffled in the mRNA segments Answer B: Enhancers can function in either orientation
whilst the UAS only functions in one. False: eukaryotes utilise enhancers
Solution
True: short double stranded mRNA are involved in initiating the interference Answer: C: genes
are reshuffled in the mRNA segments Answer B: Enhancers can function in either orientation
whilst the UAS only functions in one. False: eukaryotes utilise enhancers.
More Related Content
Similar to I have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfJUSTSTYLISH3B2MOHALI
Please help!!
I wanted to know how to add a high score to this program and wanted to add how many times
you press the spacebar
import javax.swing.*;
import java.awt.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Renderer extends JPanel{
//private static final long serialVersionUID = 1L;
protected void paintComponent(Graphics g) {
Main.main.repaint(g);
}
public static int clamp(int greenValue, int i, int j) {
// TODO Auto-generated method stub
return 0;
}
}
OTHER PART:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.*;
/**
* Created by Thomas on 11/27/2016.
*/
public class Main implements ActionListener, KeyListener{
public static Main main;
public final int WIDTH = 1400;
public final int HEIGHT = 600;
public HUD Hud;
public Renderer renderer;
public Rectangle character;
public ArrayList cloud;
public Random rand;
public boolean start = false, gameover = false;
public int tick;
public Main() {
JFrame jFrame = new JFrame();
Timer timer = new Timer(20, this);
renderer = new Renderer();
rand = new Random();
jFrame.setTitle(\"Example\");
jFrame.add(renderer);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setSize(WIDTH, HEIGHT);
jFrame.addKeyListener(this);
jFrame.setVisible(true);
cloud = new ArrayList();
character = new Rectangle(200, 220, 20, 20);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
timer.start();
}
public void repaint(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0, WIDTH, HEIGHT);
g.setColor(Color.blue);
g.fillRect(0, HEIGHT - 100, WIDTH, 100);
g.setColor(Color.green);
g.fillRect(character.x, character.y, character.width, character.height);
if (character.y >= HEIGHT - 100 || character.y < 0) {
gameover = true;
}
for (Rectangle rect : cloud) {
g.setColor(Color.white);
g.fillRect(rect.x, rect.y, rect.width, rect.height);
}
g.setColor(Color.WHITE);
g.setFont(new Font(\"Times New Roman\", 1 ,100));
if (!start) {
g.drawString(\"Press to start!\", 450, HEIGHT / 2);
}
else if (gameover) {
g.drawString(\"Game Over!\", 450, HEIGHT / 2);
}
}
public void addCloud(boolean start) {
int width = 400;
int height = 200;
if (start) {
cloud.add(new Rectangle(WIDTH + width + cloud.size() * 300, rand.nextInt(HEIGHT-120),
80, 100));
}
else {
cloud.add(new Rectangle(cloud.get(cloud.size() - 1).x + 300, rand.nextInt(HEIGHT-120), 80,
100));
}
}
public void flap() {
if (gameover) {
character = new Rectangle(300, 400, 40, 40);
cloud.clear();
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
addCloud(true);
gameover = false;
}
if (!start) {
start = true;
}
else if (!gameover) {
character.y -= 70;
tick = 0;
}
}
@Override
public void actionPerformed(ActionEvent e) {
int speed = 15;
//System.out.println(\"Space.
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
In Java Write a GUI application to simulate writing out a check. The value of a check can be
between 0 – 999,999,999,999.99. Your application will accept a name and a value. And display
it on a check. As a minimum you will display the following information: Bank name Pay to the
order of Amount in words Comma separate amount. Your GUI does not have to be exactly as
shown but must have the information indicated above.
Solution
Class cheque is used to enter values
public class Cheque extends javax.swing.JFrame {
public Cheque() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText(\"Name\");
jLabel2.setText(\"Amount\");
jButton1.setText(\"Submit\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setText(\"Enter Values\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
206, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(32, 32, 32)))
.addContainerGap(7, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addCo.
Higher Order Components and Render PropsNitish Phanse
Talk given at React foo Hyderabad 2018. Outlines the differences between higher order components and render props. Both being design patterns used primarily to aid reusability of components across a codebase.
I am getting a syntax error. I cant seem to find whats causing t.pdffashionfolionr
I am getting a syntax error. I can\'t seem to find what\'s causing this progrm even though I correct
what it\'s asking me to do. It seems to add even more errors.
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class GUI extends JFrame {
// create required GUI radios, labels, textfields and buttons
private JRadioButton iterative;
private JRadioButton recursive;
private JLabel entern;
private JLabel result;
private JLabel efficiency;
private JTextField t1;
private JTextField t2;
private JTextField t3;
private JButton compute;
private ButtonGroup radios = new ButtonGroup();
private ButtonGroup candidates = new ButtonGroup();
// create constructor for GUI
public GUI(){
super(\"Project 3\");
setLayout (new GridLayout(6,2));
setSize(275,250);
// initializing buttons and etc and adding them
iterative = new JRadioButton(\"Iterative\");
add(iterative);
recursive = new JRadioButton(\"Recursive\");
add(recursive);
// add radiobuttons to group so only one selection is possible
radios.add(iterative);
radios.add(recursive);
entern = new JLabel(\"Enter n:\");
add(entern);
result = new JLabel(\"Result:\");
add(result);
efficiency = new JLabel(\"Efficiency:\");
add(efficiency);
t1 = new JTextField();
add(t1);
compute = new JButton(\"Compute\");
add(compute);
t2 = new JTextField();
add(t2);
t3 = new JTextField();
add(t3);
/*
thehandler handler = new thehandler();
iterative.addActionListener(handler);
recursive.addActionListener(handler);
compute.addActionListener(handler);
****************************/
compute.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent b){
computeactionPerformed(b);
private void computeactionPerformed(ActionEvent b){
if ((iterative.isSelected(true))){
JOptionPane.showMessageDialog(null,\"you chose iterative\");
}
else if (recursive.isSelected(true)){
JOptionPane.showMessageDialog(null,\"you chose recursive\");
}
}
}
});
// create sub-panel for radio buttons
JPanel radioPanel = new JPanel();
radioPanel.add(iterative);
radioPanel.add(recursive);
/*
class thehandler implements ActionListener{
public void actionPerformed(ActionEvent e) {
if(e.getSource()==iterative && e.getSource()==compute){
System.out.println(\"you chose iterative\");
}
else if(e.getSource()==recursive && e.getSource()==compute){
System.out.println(\"you chose recursive\");
}
}
}
******************************/
}
public static void main(String[]args){
GUI object = new GUI();
object.setVisible(true);
object.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Solution
I have Change in code . No it\'s working without any compliantion error.
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.
Write a Java class to represent a temperature. The class has a single.pdffootwearpark
Write a Java class to represent a temperature. The class has a single data field: temperatureC
The class has a single constructor that accepts an initial temperature provided as a double
argument If this argument it
Solution
import java.util.Scanner;
public class Temperature {
double setC;
Temperature (double setC){
this.setC = setC;
}
double getC()
{
return setC;
}
public double getF()
{
return ((double)9.0/5.0 * (setC + 32)); // Fahrenheit calculation
}
public double getK()
{
return ((double)setC + 273.15);
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.print(\"Please enter the initial temperature: \");
double setC = sc.nextDouble();
Temperature temp = new Temperature (setC);
System.out.println(\"The current temperature in Celsius is: \" +temp.getC());
System.out.println(\"The current temperature in Fahrenheit is: \" +temp.getF());
System.out.println(\"The current temperature in Kelvin is: \" +temp.getK());
}
}
example:
Please enter the initial temperature: 23 The current temperature in Celsius is: 23.0 The current
temperature in Fahrenheit is: 99.0 The current temperature in Kelvin is: 296.15.
Monadic Comprehensions and Functional Composition with Query ExpressionsChris Eargle
Build monads using the C# language with a C# style, then use the appropriate methods to ensure the LINQ query syntax works with this functional design pattern. After describing monads, we will cut the middleman and apply the same techniques directly to objects and functions to achieve better results with a declarative syntax.
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxmary772
CodeZip/ButtonDemo.javaCodeZip/ButtonDemo.java// Demonstrate a push button and handle action events.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassButtonDemoimplementsActionListener{
JLabel jlab;
JTextField jtf;
ButtonDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("A Button Example");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(220,90);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Make two buttons.
JButton jbtnUp =newJButton("Up");
JButton jbtnDown =newJButton("Down");
// Create a text field.
jtf =newJTextField(10);
// Add action listeners.
jbtnUp.addActionListener(this);
jbtnDown.addActionListener(this);
// Add the buttons to the content pane.
jfrm.add(jbtnUp);
jfrm.add(jbtnDown);
jfrm.add(jtf);
// Create a label.
jlab =newJLabel("Press a button.");
// Add the label to the frame.
jfrm.add(jlab);
// Display the frame.
jfrm.setVisible(true);
}
// Handle button events.
publicvoid actionPerformed(ActionEvent ae){
if(ae.getActionCommand().equals("Up")){
jlab.setText("You pressed Up.");
FileClock clock1=newFileClock(jtf);
Thread thread1=newThread(clock1);
thread1.start();
}
else
jlab.setText("You pressed down. ");
}
publicstaticvoid main(String args[]){
// Create the frame on the event dispatching thread.
SwingUtilities.invokeLater(newRunnable(){
publicvoid run(){
newButtonDemo();
}
});
}
}
CodeZip/CBDemo.javaCodeZip/CBDemo.java// Demonstrate check boxes.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassCBDemoimplementsItemListener{
JLabel jlabSelected;
JLabel jlabChanged;
JCheckBox jcbAlpha;
JCheckBox jcbBeta;
JCheckBox jcbGamma;
CBDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("Demonstrate Check Boxes");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(280,120);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create empty labels.
jlabSelected =newJLabel("");
jlabChanged =newJLabel("");
// Make check boxes.
jcbAlpha =newJCheckBox("Alpha");
jcbBeta =newJCheckBox("Beta");
jcbGamma =newJCheckBox("Gamma");
// Events generated by the check boxes
// are handled in common by the itemStateChanged()
// method implemented by CBDemo.
jcbAlpha.addItemListener(this);
jcbBeta.addItemListener(this);
jcbGamma.addItemListener(this);
// Add checkboxes and labels to the content pane.
jfrm.add(jcbAlpha);
jfrm.add(jcbBeta);
jfrm.add(jcbGamma);
jfrm.add(jlabChanged);
jfrm.add(jlabSelected);
// Display the frame.
jfrm.setVisible(true);
}
// This is the handler for the check boxes..
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxmccormicknadine86
CodeZip/ButtonDemo.javaCodeZip/ButtonDemo.java// Demonstrate a push button and handle action events.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassButtonDemoimplementsActionListener{
JLabel jlab;
JTextField jtf;
ButtonDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("A Button Example");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(220,90);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Make two buttons.
JButton jbtnUp =newJButton("Up");
JButton jbtnDown =newJButton("Down");
// Create a text field.
jtf =newJTextField(10);
// Add action listeners.
jbtnUp.addActionListener(this);
jbtnDown.addActionListener(this);
// Add the buttons to the content pane.
jfrm.add(jbtnUp);
jfrm.add(jbtnDown);
jfrm.add(jtf);
// Create a label.
jlab =newJLabel("Press a button.");
// Add the label to the frame.
jfrm.add(jlab);
// Display the frame.
jfrm.setVisible(true);
}
// Handle button events.
publicvoid actionPerformed(ActionEvent ae){
if(ae.getActionCommand().equals("Up")){
jlab.setText("You pressed Up.");
FileClock clock1=newFileClock(jtf);
Thread thread1=newThread(clock1);
thread1.start();
}
else
jlab.setText("You pressed down. ");
}
publicstaticvoid main(String args[]){
// Create the frame on the event dispatching thread.
SwingUtilities.invokeLater(newRunnable(){
publicvoid run(){
newButtonDemo();
}
});
}
}
CodeZip/CBDemo.javaCodeZip/CBDemo.java// Demonstrate check boxes.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclassCBDemoimplementsItemListener{
JLabel jlabSelected;
JLabel jlabChanged;
JCheckBox jcbAlpha;
JCheckBox jcbBeta;
JCheckBox jcbGamma;
CBDemo(){
// Create a new JFrame container.
JFrame jfrm =newJFrame("Demonstrate Check Boxes");
// Specify FlowLayout for the layout manager.
jfrm.setLayout(newFlowLayout());
// Give the frame an initial size.
jfrm.setSize(280,120);
// Terminate the program when the user closes the application.
jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create empty labels.
jlabSelected =newJLabel("");
jlabChanged =newJLabel("");
// Make check boxes.
jcbAlpha =newJCheckBox("Alpha");
jcbBeta =newJCheckBox("Beta");
jcbGamma =newJCheckBox("Gamma");
// Events generated by the check boxes
// are handled in common by the itemStateChanged()
// method implemented by CBDemo.
jcbAlpha.addItemListener(this);
jcbBeta.addItemListener(this);
jcbGamma.addItemListener(this);
// Add checkboxes and labels to the content pane.
jfrm.add(jcbAlpha);
jfrm.add(jcbBeta);
jfrm.add(jcbGamma);
jfrm.add(jlabChanged);
jfrm.add(jlabSelected);
// Display the frame.
jfrm.setVisible(true);
}
// This is the handler for the check boxes. ...
The equation you should use is just a variation of the PV formula.pdfannaimobiles
The equation you should use is just a variation of the PV formula:
r = (FV/PV)1/t -1
r = ($3.20/$1.50)1/5 - 1
=
Solution
The equation you should use is just a variation of the PV formula:
r = (FV/PV)1/t -1
r = ($3.20/$1.50)1/5 - 1
=.
True short double stranded mRNA are involved in initiating the inte.pdfannaimobiles
True: short double stranded mRNA are involved in initiating the interference Answer: C: genes
are reshuffled in the mRNA segments Answer B: Enhancers can function in either orientation
whilst the UAS only functions in one. False: eukaryotes utilise enhancers
Solution
True: short double stranded mRNA are involved in initiating the interference Answer: C: genes
are reshuffled in the mRNA segments Answer B: Enhancers can function in either orientation
whilst the UAS only functions in one. False: eukaryotes utilise enhancers.
Yes, it would react similarly, since boric oxide .pdfannaimobiles
Yes, it would react similarly, since boric oxide is similar to carbon dioxide in
dissolving water and will produce boric acid as result
Solution
Yes, it would react similarly, since boric oxide is similar to carbon dioxide in
dissolving water and will produce boric acid as result.
Intermediate species means species that have 2 ch.pdfannaimobiles
Intermediate species means species that have 2 characteristics 1. they are a product
in a previous step 2. they are consumed (they are reactants) in the following step Note that they
must have both of these characteristics to be considered intermediates. If they have one or the
other they are not counted as intermediates. Notice how NO is being produced in step I and being
used up in step II. That is why it is an intermediate.
Solution
Intermediate species means species that have 2 characteristics 1. they are a product
in a previous step 2. they are consumed (they are reactants) in the following step Note that they
must have both of these characteristics to be considered intermediates. If they have one or the
other they are not counted as intermediates. Notice how NO is being produced in step I and being
used up in step II. That is why it is an intermediate..
In primitive cells atoms are present at the corne.pdfannaimobiles
In primitive cells atoms are present at the corners only. Among the given unit cells
unit cell 1 is primitive cell. In remaining two unit cells there are atoms at center also.
Solution
In primitive cells atoms are present at the corners only. Among the given unit cells
unit cell 1 is primitive cell. In remaining two unit cells there are atoms at center also..
Hg2+ is more water soluble, methyl mercury HgCH3+.pdfannaimobiles
Hg2+ is more water soluble, methyl mercury HgCH3+ is more lipid soluble.
CH3Hg, polar molecules would combine to form a substance similar to water but would be more
acidic as a result of mixing two non-like particles in a solution
Solution
Hg2+ is more water soluble, methyl mercury HgCH3+ is more lipid soluble.
CH3Hg, polar molecules would combine to form a substance similar to water but would be more
acidic as a result of mixing two non-like particles in a solution.
HCl is a polar-covalent compound and also Acetoni.pdfannaimobiles
HCl is a polar-covalent compound and also Acetonitrile they are soluble dueto
hydrogen - bonding between them. So they have London-dispersion forces between them.
Solution
HCl is a polar-covalent compound and also Acetonitrile they are soluble dueto
hydrogen - bonding between them. So they have London-dispersion forces between them..
for a compound to be soluble in water 1. it shou.pdfannaimobiles
for a compound to be soluble in water 1. it should have a large dipolemoment or 2.
it should be ionic or 3. it should form H bond with water in first pair CH3CH2CH3 is non polar
and is not soluble but CH2OHCHOHCH2OH is soluble in water by making H bonds. in second
pair Though CH3Cl has little dipolemoment HCl has very higher dipolemomet because of charge
separation and is readily soluble in water
Solution
for a compound to be soluble in water 1. it should have a large dipolemoment or 2.
it should be ionic or 3. it should form H bond with water in first pair CH3CH2CH3 is non polar
and is not soluble but CH2OHCHOHCH2OH is soluble in water by making H bonds. in second
pair Though CH3Cl has little dipolemoment HCl has very higher dipolemomet because of charge
separation and is readily soluble in water.
TRUE The Reynolds number of falling 2.5 micrometer flyash particles .pdfannaimobiles
TRUE The Reynolds number of falling 2.5 micrometer flyash particles in air exceed that of same
size of soot particle by more than 50% because the soot particle is a outcome produced due to in
complete combustion of carbon particles and very lighter in density compared to the flyash.
Solution
TRUE The Reynolds number of falling 2.5 micrometer flyash particles in air exceed that of same
size of soot particle by more than 50% because the soot particle is a outcome produced due to in
complete combustion of carbon particles and very lighter in density compared to the flyash..
the electron rich molecule is a central Xe with 4 F singlebonded.pdfannaimobiles
the electron rich molecule is a central Xe with 4 F singlebonded to it, 1 lone pair, and 1 oxygen
molecule double bonded toit (if this is confusing the molecule is called xenonoxytetrafluoride so
you can google it or whatever)
XeF6+H2O XeOF4 +2HF
Solution
the electron rich molecule is a central Xe with 4 F singlebonded to it, 1 lone pair, and 1 oxygen
molecule double bonded toit (if this is confusing the molecule is called xenonoxytetrafluoride so
you can google it or whatever)
XeF6+H2O XeOF4 +2HF.
The given formulae themselves are explicit. Explicit means direct i..pdfannaimobiles
The given formulae themselves are explicit. Explicit means direct i.e., the ones having a clear
expression of one variable in terms of several others which is the case here, as an is expressed as
a direct function of n and several lower order terms. By direct or clear we mean that expression
which represents, the variable (on the LHS of the equation) that is expressed, as a function of
other variables does not involve the expressed variable (in the RHS of the equation).
Solution
The given formulae themselves are explicit. Explicit means direct i.e., the ones having a clear
expression of one variable in terms of several others which is the case here, as an is expressed as
a direct function of n and several lower order terms. By direct or clear we mean that expression
which represents, the variable (on the LHS of the equation) that is expressed, as a function of
other variables does not involve the expressed variable (in the RHS of the equation)..
The answer is Meiosis, It occurs in human body at reporductive organ.pdfannaimobiles
The answer is Meiosis, It occurs in human body at reporductive organs only. For healing and
growth Mitosis plays a crucial role.
Solution
The answer is Meiosis, It occurs in human body at reporductive organs only. For healing and
growth Mitosis plays a crucial role..
Structure of HemoglobinHemoglobin is a chromo protein and is found.pdfannaimobiles
Structure of Hemoglobin
Hemoglobin is a chromo protein and is found in red blood cells, it’s a conjugated protein (heme
as prosthetic group + globin as the protein part apoprotein). Adults have 14.0 to 16.0 gm% of Hb
and 90 mg/kg of Hb will be produced and destroyed in the body on daily basis. Molecular weight
of Hb is 67,000 and 3.4 mg of iron present in each gram of Hb.
The combination of iron with a porphyrin ring produces the heme.
Structure of Heme
Heme is derived from porphyrin and porphyrins are cyclic compounds and are formed when 4
pyrrole rings fuse and are linked by methenyl bridges and the four rings are named as I,II,III, IV
and Alpha, beta, gamma and delta are the bridges. To the side chain of Porphyrins, four pyrrole
rings are attached.
We can find one ferrous atom (Fe++) co-ordinated at the centre of the of protoporphyrin IX tetra
pyrrole ring.
Structure of Globin
We can find the tetramer of globin polypeptide chains and each Hb molecule will have 4 Heme
units and the subunits of hemoglobin are found to be arranged in a tetrahedral array. And this
arrangement will give tight spherical overall appearance (which allows the polar residues being
on the exposed surface and keeps the non-polar interactions internal).
A molecule of hemoglobin is known to transport up to four oxygen molecules and here iron ion
interacts with oxygen molecule to form oxyhemoglobin. Oxyhemoglobin blood is bright red and
interactions between the iron–oxygen are very weak and thus can easily be separated without
disturbing the heme unit/ the oxygen molecule (completely reversible binding).
Deoxyhemoglobin is the hemoglobin molecule without oxygen and dark red..
Primary structure of hemoglobin
141 AA residues will be present in linear sequence of alpha chain contains and non- (, and )
chains will be of 146 amino acids in length (here the beta chain will have valine and histidine as
their first residues and Tyr b145 and His b146 found at C-terminal residues). Only 10 residue
difference between the delta chain and the beta chain.
Secondary structure of hemoglobin
We can find nearly 75 percent of the amino acids in or chains in a helical arrangement and 8
helical areas will be found in the chains.
Tertiary structure of or chains
Sphere type o structure will result during the tertiary folding of each globin chain and this
folding brings the Polar or charged side chains directed towards the outer surface of the subunit
and non-polar structures directed inwards making Hb water soluble, Heme pocket will be created
and is open-toped cleft in the surface and this folding will bring Hb in correct orientation to
allow these bonds to form.
Quaternary structure of hemoglobin
Finally the Hb tetramer will be formed composed of two identical dimers ()1and ()2. These two
polypeptide chains are held together tightly (though hydrophobic and ionic interactions andy
hydrogen bonding). The two dimers can move with respect to each other.
T and R forms of Hb
T form (taut structure.
Starch agar consists of starch. The secretion of amylase enzyme by s.pdfannaimobiles
Starch agar consists of starch. The secretion of amylase enzyme by some microbes cause
hydrolysis of starch around the colony. The plate flooded with iodine solution after incubation
period.
The amylase prodding colonies appear unstained and form a color zone because they’ve
hydrolyzed starch. The colonies that don’t produce amylase, still have starch in their surrounding
and appear dark-blue or black (color of starch-iodine complex) by reaction of starch with iodine.
There is no clearance zone around the amylase-negative colonies.
Thus, the media differentiates amylase producers from non-amylase produces and can be treated
as a differential media.
Solution
Starch agar consists of starch. The secretion of amylase enzyme by some microbes cause
hydrolysis of starch around the colony. The plate flooded with iodine solution after incubation
period.
The amylase prodding colonies appear unstained and form a color zone because they’ve
hydrolyzed starch. The colonies that don’t produce amylase, still have starch in their surrounding
and appear dark-blue or black (color of starch-iodine complex) by reaction of starch with iodine.
There is no clearance zone around the amylase-negative colonies.
Thus, the media differentiates amylase producers from non-amylase produces and can be treated
as a differential media..
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Normal Labour/ Stages of Labour/ Mechanism of Labour
I have done it under neatbeans IDE and just added ToggleGroup for gr.pdf
1. I have done it under neatbeans IDE and just added ToggleGroup for grouping radion buttons
inorder to select one at time.
package tempconverter;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Tempconverter extends Application {
/**
* @param args the command line arguments executes project
*/
final ToggleGroup group1 = new ToggleGroup();
final ToggleGroup group2 = new ToggleGroup();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane pane = new BorderPane(); //the big picture
BorderPane p1 = new BorderPane();//top
2. BorderPane p2 = new BorderPane(); //bottom
Label temp = new Label("Enter a temperature"); //enter temp label
Label convertTemp = new Label("Converted temperature"); //converted temp label
Label input = new Label("Input Scale");//input scale label
Label output = new Label("Output Scale");//Output Scale label
TextField tempText = new TextField(); //text field to enter temp
TextField convertText = new TextField(); //output textfield for the converted temp
VBox scaleIn = new VBox(15);
VBox scaleOut = new VBox(15);
RadioButton c = new RadioButton("celcius"); //button for celcius on input side
c.setToggleGroup(group1);
RadioButton f = new RadioButton("Fahrenheit");//button for Fahrenheit on input side
f.setToggleGroup(group1);
RadioButton k = new RadioButton("kelvin");//button for kelvin on inputside
k.setToggleGroup(group1);
RadioButton c1 = new RadioButton("celcius");//button for celcius on outputside
c1.setToggleGroup(group2);
RadioButton f1 = new RadioButton("Fahrenheit"); //button for f on output side
f1.setToggleGroup(group2);
RadioButton k1 = new RadioButton("kelvin"); //button for kelvin on output side
k1.setToggleGroup(group2);
p1.setStyle("-fx-border-color:red"); //set top border pane to red
p1.setRight(tempText);
p1.setLeft(temp);
pane.setTop(p1);
pane.setBottom(p2);
p2.setLeft(convertTemp);
p2.setRight(convertText);
p2.setStyle("-fx-border-color:red");
input.setPrefWidth(100);
output.setPrefWidth(100);
c.setPrefWidth(100);
f.setPrefWidth(100);
k.setPrefWidth(100);
3. c1.setPrefWidth(100);
f1.setPrefWidth(100);
k1.setPrefWidth(100);
scaleIn.setStyle("-fx-border-color:red");
scaleIn.getChildren().addAll(input, c, f, k);
scaleIn.setAlignment(Pos.CENTER);
pane.setLeft(scaleIn);
TextArea error = new TextArea();
error.setEditable(false);//makes the error message unable to edit
convertText.setEditable(false);//makes output unable to edit
ScrollPane p3 = new ScrollPane(error);
p3.setStyle("-fx-border-color:red");
pane.setCenter(p3);
scaleOut.setStyle("-fx-border-color:red");
scaleOut.getChildren().addAll(output, c1, f1, k1);
scaleOut.setAlignment(Pos.CENTER);
pane.setRight(scaleOut);
//makes it so the input can only be digits.
/*tempText.setOnAction(new EventHandler() {
@Override
public void handle(ActionEvent e) {
// force the field to be numeric only
tempText.textProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, String oldValue, String newValue) {
if (!newValue.matches("d*")) {
tempText.setText(newValue.replaceAll("[^d]", ""));
}
}
});
{
}
}
});
*/
group1.selectedToggleProperty().addListener(new ChangeListener(){
4. public void changed(ObservableValue ov,
Toggle old_toggle, Toggle new_toggle) {
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == c1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = data * 1.8 + 32;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = data + 275.15;
convertText.setText(Double.toString(result));
}
// f to other
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == f1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = (data * 459.67) * 5/9;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = (data - 32) * 5/9;
convertText.setText(Double.toString(result));
}
//k to other
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == k1){
String data= tempText.getText();
convertText.setText(data);
}
5. if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = (data * (9/5)) - 459.67;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = data -273.15;
convertText.setText(Double.toString(result));
}
}
});
group2.selectedToggleProperty().addListener(new ChangeListener(){
public void changed(ObservableValue ov,
Toggle old_toggle, Toggle new_toggle) {
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == c1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = data * 1.8 + 32;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = data + 275.15;
convertText.setText(Double.toString(result));
}
//f to other
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == f1){
String data= tempText.getText();
convertText.setText(data);
}
6. if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = (data * 459.67) * 5/9;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = (data - 32) * 5/9;
convertText.setText(Double.toString(result));
}
//k to other
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == k1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = (data * (9/5)) - 459.67;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = data -273.15;
convertText.setText(Double.toString(result));
}
}
});
convertText.setOnAction(e -> {
//code for the output hander
});
//event handlers for the radio buttons
c.setOnAction(e -> {
if (c.isSelected()) {
7. //need code in here
}
});
f.setOnAction(e -> {
if (f.isSelected()) {
//need code in here
}
});
k.setOnAction(e -> {
if (k.isSelected()) {
//need code in here
}
});
//set action handler for the radio buttons
c1.setOnAction(e -> {
if (c1.isSelected()) {
//need code in here
}
});
f1.setOnAction(e -> {
if (f1.isSelected()) {
//need code in here
}
});
k1.setOnAction(e -> {
if (k1.isSelected()) {
//need code in here
}
});
Scene scene = new Scene(pane, 400, 200);
primaryStage.setTitle("Temp Conversion");
primaryStage.setScene(scene);
primaryStage.show();
}
}
8. Solution
I have done it under neatbeans IDE and just added ToggleGroup for grouping radion buttons
inorder to select one at time.
package tempconverter;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class Tempconverter extends Application {
/**
* @param args the command line arguments executes project
*/
final ToggleGroup group1 = new ToggleGroup();
final ToggleGroup group2 = new ToggleGroup();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
BorderPane pane = new BorderPane(); //the big picture
9. BorderPane p1 = new BorderPane();//top
BorderPane p2 = new BorderPane(); //bottom
Label temp = new Label("Enter a temperature"); //enter temp label
Label convertTemp = new Label("Converted temperature"); //converted temp label
Label input = new Label("Input Scale");//input scale label
Label output = new Label("Output Scale");//Output Scale label
TextField tempText = new TextField(); //text field to enter temp
TextField convertText = new TextField(); //output textfield for the converted temp
VBox scaleIn = new VBox(15);
VBox scaleOut = new VBox(15);
RadioButton c = new RadioButton("celcius"); //button for celcius on input side
c.setToggleGroup(group1);
RadioButton f = new RadioButton("Fahrenheit");//button for Fahrenheit on input side
f.setToggleGroup(group1);
RadioButton k = new RadioButton("kelvin");//button for kelvin on inputside
k.setToggleGroup(group1);
RadioButton c1 = new RadioButton("celcius");//button for celcius on outputside
c1.setToggleGroup(group2);
RadioButton f1 = new RadioButton("Fahrenheit"); //button for f on output side
f1.setToggleGroup(group2);
RadioButton k1 = new RadioButton("kelvin"); //button for kelvin on output side
k1.setToggleGroup(group2);
p1.setStyle("-fx-border-color:red"); //set top border pane to red
p1.setRight(tempText);
p1.setLeft(temp);
pane.setTop(p1);
pane.setBottom(p2);
p2.setLeft(convertTemp);
p2.setRight(convertText);
p2.setStyle("-fx-border-color:red");
input.setPrefWidth(100);
output.setPrefWidth(100);
c.setPrefWidth(100);
f.setPrefWidth(100);
10. k.setPrefWidth(100);
c1.setPrefWidth(100);
f1.setPrefWidth(100);
k1.setPrefWidth(100);
scaleIn.setStyle("-fx-border-color:red");
scaleIn.getChildren().addAll(input, c, f, k);
scaleIn.setAlignment(Pos.CENTER);
pane.setLeft(scaleIn);
TextArea error = new TextArea();
error.setEditable(false);//makes the error message unable to edit
convertText.setEditable(false);//makes output unable to edit
ScrollPane p3 = new ScrollPane(error);
p3.setStyle("-fx-border-color:red");
pane.setCenter(p3);
scaleOut.setStyle("-fx-border-color:red");
scaleOut.getChildren().addAll(output, c1, f1, k1);
scaleOut.setAlignment(Pos.CENTER);
pane.setRight(scaleOut);
//makes it so the input can only be digits.
/*tempText.setOnAction(new EventHandler() {
@Override
public void handle(ActionEvent e) {
// force the field to be numeric only
tempText.textProperty().addListener(new ChangeListener() {
@Override
public void changed(ObservableValue observable, String oldValue, String newValue) {
if (!newValue.matches("d*")) {
tempText.setText(newValue.replaceAll("[^d]", ""));
}
}
});
{
}
}
});
*/
11. group1.selectedToggleProperty().addListener(new ChangeListener(){
public void changed(ObservableValue ov,
Toggle old_toggle, Toggle new_toggle) {
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == c1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = data * 1.8 + 32;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = data + 275.15;
convertText.setText(Double.toString(result));
}
// f to other
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == f1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = (data * 459.67) * 5/9;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = (data - 32) * 5/9;
convertText.setText(Double.toString(result));
}
//k to other
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == k1){
String data= tempText.getText();
convertText.setText(data);
12. }
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = (data * (9/5)) - 459.67;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = data -273.15;
convertText.setText(Double.toString(result));
}
}
});
group2.selectedToggleProperty().addListener(new ChangeListener(){
public void changed(ObservableValue ov,
Toggle old_toggle, Toggle new_toggle) {
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == c1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = data * 1.8 + 32;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == c && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = data + 275.15;
convertText.setText(Double.toString(result));
}
//f to other
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == f1){
String data= tempText.getText();
convertText.setText(data);
13. }
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == k1){
double data = Double.parseDouble(tempText.getText());
double result = (data * 459.67) * 5/9;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == f && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = (data - 32) * 5/9;
convertText.setText(Double.toString(result));
}
//k to other
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == k1){
String data= tempText.getText();
convertText.setText(data);
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == f1){
double data = Double.parseDouble(tempText.getText());
double result = (data * (9/5)) - 459.67;
convertText.setText(Double.toString(result));
}
if(group1.getSelectedToggle() == k && group2.getSelectedToggle() == c1){
double data = Double.parseDouble(tempText.getText());
double result = data -273.15;
convertText.setText(Double.toString(result));
}
}
});
convertText.setOnAction(e -> {
//code for the output hander
});
//event handlers for the radio buttons
c.setOnAction(e -> {
14. if (c.isSelected()) {
//need code in here
}
});
f.setOnAction(e -> {
if (f.isSelected()) {
//need code in here
}
});
k.setOnAction(e -> {
if (k.isSelected()) {
//need code in here
}
});
//set action handler for the radio buttons
c1.setOnAction(e -> {
if (c1.isSelected()) {
//need code in here
}
});
f1.setOnAction(e -> {
if (f1.isSelected()) {
//need code in here
}
});
k1.setOnAction(e -> {
if (k1.isSelected()) {
//need code in here
}
});
Scene scene = new Scene(pane, 400, 200);
primaryStage.setTitle("Temp Conversion");
primaryStage.setScene(scene);
primaryStage.show();
}
}