Difference between CLI and GUI

Difference between CLI and GUI

CLI enable users to type manual command in order to perform the desired task whereas in GUI users provided visuals to interact with the operating system such as buttons, icons, images etc. … GUI systems require mouse and keyboard while CLI just require a keyboard to work.

Difference between CLI and GUI

CLI

  • The command-line interface enables a user to communicate with the system through commands.
  • The keyboard is used.
  • Hard to perform an operation and require expertise.
  • High Precision
  • Intransigent
  • Low Memory consumption
  • Appearance can’t be changed
  • Fast
  • Scope of potential improvements

GUI

  • The Graphical User interface permits a user to interact with the system by using graphics which includes images, icons, etc.
  • Mouse and keyboard is used
  • Easy to perform an operation and doesn’t require expertise.
  • Low Precision
  • More Flexible
  • High Memory consumption
  • Appearance can be changed
  • Slow
  • Bounded

Java Swing:

Swing is a part of JFC (Java Foundation Classes). Building Graphical User Interface in Java requires the use of Swings. Swing Framework contains a large set of components which allow high level of customization and provide rich functionalities, and is used to create window based applications.
Java swing components are lightweight, platform independent; provide powerful components like tables, scroll panels, buttons, list, color chooser, etc.
// Java program to create frames
// using association

import javaxswing.;

public class test1
{
JFrame frame;
test1()
{
frame=new JFrame(“first way”);
JButton button = new JButton(“let’s see”);
button.setBounds(200, 150, 90, 50);
setting close operation

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
adds button in JFrame
frame.add(button);
frame.setSize(500, 600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args)
{
new test1();
}
}

Java AWT:

AWT stands for Abstract Window Toolkit. It is a platform dependent API for creating Graphical User Interface (GUI) for java programs.
import java.awt.*;  
class First extends Frame{  
First(){  
Button b=new Button(“click me”);  
b.setBounds(30,100,80,30);
add(b);//adding button into frame  
setSize(300,300);
setLayout(null);
setVisible(true);
}  
public static void main(String args[]){  
First f=new First();  
}}  

Add a Comment

Your email address will not be published. Required fields are marked *