8c c. Build a Tip Calculator app using several JavaFX components and learn how to respond to user interactions with the GUI.

 import javafx.application.Application;  

import javafx.scene.Group;  

import javafx.scene.Scene;  

import javafx.scene.effect.ImageInput;  

import javafx.scene.image.Image;  

import javafx.scene.paint.Color;  

import javafx.scene.shape.Rectangle;  

import javafx.stage.Stage;  

public class ImageExample extends Application 

{  

    public void start(Stage primaryStage) throws Exception 

    {  

        // TODO Auto-generated method stub  

        Image img = new Image("https://picsum.photos/536/354");  

        ImageInput imginput = new ImageInput();  

        Rectangle rect = new Rectangle();  

        imginput.setSource(img);  

        imginput.setX(20);  

        imginput.setY(100);  

        Group root = new Group();  

        rect.setEffect(imginput);  

        root.getChildren().add(rect);  

        Scene scene = new Scene(root,530,500,Color.BLACK);  

        primaryStage.setScene(scene);  

        primaryStage.setTitle("ImageInput Example");  

        primaryStage.show();  

    }   

    public static void main(String[] args) 

    {  

        launch(args);  

    }   

}   

No comments

9.C Write a java program to connect to a database using JDBC and delete values from it.

 import java.sql.*;  public class result  {        public static void main(String[] args)      {          Connection con=null;       ...