A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
This talk was given at FrenchKit 2019 which took place in Paris, France on 7-8 October.
With SwiftUI and Combine, Apple is changing its approach for how we define data flows and UI. As we move from playing with sample code to writing production apps, it’s time to start thinking about testing. Nataliya will show how to apply several learnings from her experience with declarative UIs to this new reality.
QA Fest 2019. Алексей Альтер-Песоцкий. Snapshot testing with native mobile fr...QAFest
Я расскажу про мобильное тестирование, посредством поскриншотового сравнения, с использованием нативных фреймворков (Espresso & XCTest) и сторонних библиотек. Открою секрет, что поскриншотовое сравнение доступно как в Unit, так и в UI тестах, рассмотрю, какие элементы и в каком виде доступны для верификации и поделюсь радостями и болью жизни со снэпшотами.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
This talk was given at FrenchKit 2019 which took place in Paris, France on 7-8 October.
With SwiftUI and Combine, Apple is changing its approach for how we define data flows and UI. As we move from playing with sample code to writing production apps, it’s time to start thinking about testing. Nataliya will show how to apply several learnings from her experience with declarative UIs to this new reality.
QA Fest 2019. Алексей Альтер-Песоцкий. Snapshot testing with native mobile fr...QAFest
Я расскажу про мобильное тестирование, посредством поскриншотового сравнения, с использованием нативных фреймворков (Espresso & XCTest) и сторонних библиотек. Открою секрет, что поскриншотовое сравнение доступно как в Unit, так и в UI тестах, рассмотрю, какие элементы и в каком виде доступны для верификации и поделюсь радостями и болью жизни со снэпшотами.
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
28th July 2016 iOS Dev Scout Meetup @ Propertyguru
Presentation on
- XCUITest: how to easily setup and run XCUITests
- Gherkin: how to setup Gherkin for your XCUITests
Getting touchy - an introduction to touch and pointer events / TPAC 2016 / Li...Patrick Lauke
Beyond smartphones and tablets, touchscreens are finding their way into laptops and even desktop computers. With hardware support for touch becoming increasingly ubiquitous, it's time to explore what new possibilities are available to developers. This session will cover the basics of handling touch events - from making sure simple single-tap interactions are as responsive as possible, all the way to examples of full multitouch, gesture-enabled elements.
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsVladimir Roudakov
Does your website run automated nightly tests and reports on what was changed or broken?
Is automated testing part of your daily routine or deployment process?
If not, then meet NightwatchJS: open source automated testing framework based on popular Selenium browser testing tool.
In this session we will cover
- basics of browser automated testing
- nightwatchJS scripts [no coding experience required!]
- writing tests for custom functionality
- headless browser setup on Linux
- alternative browser testing framework
Slides and video is available here: https://events.drupal.org/dublin2016/sessions/automated-browser-testing-nightwatchjs
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
This presentation explores and discusses the practical and useful of Regular Expressions covering username validation, complex and strong password validation, password strength checker, email validation, and finally image file extension validation.
This presentation introduces Java Applet and Java Graphics in detail with examples and finally using the concept of both applet and graphics code the analog clock project to depict how to use them in real life challenges and applications.
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
28th July 2016 iOS Dev Scout Meetup @ Propertyguru
Presentation on
- XCUITest: how to easily setup and run XCUITests
- Gherkin: how to setup Gherkin for your XCUITests
Getting touchy - an introduction to touch and pointer events / TPAC 2016 / Li...Patrick Lauke
Beyond smartphones and tablets, touchscreens are finding their way into laptops and even desktop computers. With hardware support for touch becoming increasingly ubiquitous, it's time to explore what new possibilities are available to developers. This session will cover the basics of handling touch events - from making sure simple single-tap interactions are as responsive as possible, all the way to examples of full multitouch, gesture-enabled elements.
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsVladimir Roudakov
Does your website run automated nightly tests and reports on what was changed or broken?
Is automated testing part of your daily routine or deployment process?
If not, then meet NightwatchJS: open source automated testing framework based on popular Selenium browser testing tool.
In this session we will cover
- basics of browser automated testing
- nightwatchJS scripts [no coding experience required!]
- writing tests for custom functionality
- headless browser setup on Linux
- alternative browser testing framework
Slides and video is available here: https://events.drupal.org/dublin2016/sessions/automated-browser-testing-nightwatchjs
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
This presentation explores and discusses the practical and useful of Regular Expressions covering username validation, complex and strong password validation, password strength checker, email validation, and finally image file extension validation.
This presentation introduces Java Applet and Java Graphics in detail with examples and finally using the concept of both applet and graphics code the analog clock project to depict how to use them in real life challenges and applications.
Regular Expressions (Regex) is powerful and convenient to use for string manipulation i.e. matching and validation, extracting and capturing, modifying and substitution, etc. This presentation covers Regular Expression with real world examples and demos.
PHP Basic and Fundamental Questions and Answers with Detail ExplanationOXUS 20
These PHP basic and fundamental questions and answers with detail explanation help students and learners to think comprehensive, and to seek more to understand the concept and the root of each topic concretely.
Object Oriented Programming (OOP) makes it easier for programmers to structure and form software programs; since individual objects can be modified without touching other aspects of the program.
With this presentation we are covering most OOP features (Class, Object, Inheritance, Polymorphism, Encapsulation, etc.) with real life examples.
With Unicode you can program and accomplish many funny, cool and useful programs and tools as for instance, Abjad Calculator calculating the numerical value of letters derived from the Arabic alphabet through the use of the Abjad writing system, Bubble Text Generator to write letters in circle, Flip Text Generator to write letters upside down, Google Transliteration to convert English names to Persian/Arabic, etc.
Fal-e-Hafez (Omens of Hafez) Cards in Persian using JavaOXUS 20
This presentation explains step by step how to develop and code Fal-e Hafez (Omens of Hafez) Cards in Persian Using JAVA. There are several applications which are coded by different programming languages i.e. Java languages for Desktops and Mobiles, HTML and CSS and PHP for Web Pages, etc. and this shows the importance of Omens of Hafez among the Persian people.
This tutorial explains step by step writing a simple guessing game where the player guess the number selected by the computer and the goal is to introduce the power and usage of RANDOM as well as the how to benefit CURRENTTIMEMILLIS method of the System class in order to check how much it took the player guessing the correct number.
Object Oriented Concept Static vs. Non StaticOXUS 20
Static is not the true intend of Object Oriented Design and Concept.
For instance, we turn a LAMP "off" it does not suppose to turn the LAMPS of the entire world goes "off".
To review computer basics, programs, and operating systems
To explore the relationship between Java and the World Wide Web
To distinguish the terms API, IDE, and JDK
To write a simple Java program
To display output on the console
To explain the basic syntax of a Java program
To create, compile, and run Java programs
(GUI) To display output using the JOptionPane output dialog boxes
Web Design and Development Life Cycle and TechnologiesOXUS 20
This presentation is an introduction to the design, creation, and maintenance of web design and development life cycle and web technologies. With it, you will learn about the web technologies, the life cycle of developing an efficient website and web application and finally some web essentials questions will be provided and reviewed.
Create Splash Screen with Java Step by StepOXUS 20
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
Everything about Database JOINS and RelationshipsOXUS 20
Today, we continue our journey into the world of RDBMS (relational database management systems) and SQL (Structured Query Language).
In this presentation, you will understand about some key definitions and then you will learn how to work with multiple tables that have relationships with each other.
First, we will go covering some core concepts and key definitions, and then will begin working with JOINs queries in SQL.
With Unicode you can program and accomplish many funny, cool and useful programs and tools as for instance, Abjad Calculator, Bubble Text Generator to write letters in circle, Flip Text Generator to write letters upside down, Google Transliteration to convert English names to Persian/Arabic, etc...
Jdbc Complete Notes by Java Training Center (Som Sir)Som Prakash Rai
This Jdbc (Java Database Connectivity) notes contains the complete indepth Explanation of JDBC by Som Prakash Rai Sir. This is the Running notes of java Training center ,(J.T.C Noida), www.jtcindia.org
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
While Java’s strict type system is a great help for avoiding programming errors, it also takes away some of the flexibility that developers appreciate when using dynamic languages. By using runtime code generation, it is possible to bring some of this flexibility back to the Java virtual machine. For this reason, runtime code generation is widely used by many state-of-the-art Java frameworks for implementing POJO-centric APIs but it also opens the door to assembling more modular applications. This presentation offers an introduction to the complex of runtime code generation and its use on the Java platform. Furthermore, it discusses the up- and downsides of several code generation libraries such as ASM, Javassist, cglib and Byte Buddy.
package buttongui;
import static com.sun.deploy.config.JREInfo.clear;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ButtonGUI extends Application implements EventHandler {
@Override
public void start(Stage primaryStage) {
btn.setText(\"Find\");
btn.setOnAction(this);
btn1.setText(\"Clear\");
btn1.setOnAction(this);
btn2.setText(\"Exit\");
btn2.setOnAction(this);
FlowPane flow = new FlowPane();
flow.getChildren().addAll(btn,btn1,btn2);
BorderPane border = new BorderPane();
border.setCenter(flow);
Scene scene = new Scene(border, 300,250);
primaryStage.setTitle(\"ButtonGUI\");
primaryStage.setScene(scene);
primaryStage.show();
}
@Override
public void handle(ActionEvent event) {
String tx =\"Hello world\";
System.out.println(tx);
if(btn2 == event.getSource()){
System.out.println(\"Exit Pressed\");
System.exit(0);
}
}
public static void main(String[] args)throws Exception {
launch(args);
}
}
Simple Exit & Clear Events) Add the Exit Event to your ButtonsGUI. Make it so that when the
user clicks on the Exit button, the application ends. Add the Clear Event to your ButtonsGUI.
Make it so that when the user clicks on the Clear button, the Text on all the Buttons is cleared.
please solve the clear button so that when the user clicks on the Clear button, the Text on all the
Buttons is cleared. thanks
Solution
Follow below steps to Add the Exit Event to your Buttons GUI:
1. Right Click on the Exit button and choose Events --> Action --> ActionPerformed.
2. The IDE will automatically add an ActionListener to the Exit button and generate a handler
method for handling the listener\'s actionPerformed method.
3. The IDE will open up the Source Code window and scroll to where you implement the action
you want the button to do when the button is pressed.
4. Add code for what we want the Exit Button to do. You will have to type System.exit(0);
5. Your final Exit button code should look like this:
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)
{
System.exit(0);
}
Follow below steps to Add the Clear Event to your Buttons GUI:
In below example the text in two of our jTextFields will clear, it is overwriting the existing Text
with a blank.
1. Click on the Design tab at the top of your work area to go back to the Form Design
2. Right Click on the Clear button (jButton1). From the pop-up menu select Events --> Action --
> ActionPerformed.
3. Your final source code will be:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
jTextField1.setText(\"\");
jTextField2.setText(\"\");
}
Note: You can add as many jTextField depending upon number of buttons y.
REX about JavaFX8 used in SlideshowFX. This presentation covers concept from JavaFX as well as technologies like OSGi, Vert.x, LeapMotion, nashorn and friends in order to make them communicate inside one application developed in JavaFX.
This presentation was made at the ElsassJUG
Does testability imply good design - Andrzej Jóźwiak - TomTom Dev Day 2022Andrzej Jóźwiak
Those of us who are writing unit tests, integration tests and end to end tests often think that if the code is testable then it means it is well designed. But is it a true statement?
Badly designed code can be tested but often at a large cost. After years of work I learned that striving for testability can sometimes lead to damaged designs.
Classes that expose methods just so the tests could check assertions about their state, broken encapsulation just to test properly!
Tests often say more about our code then people would like to admit, large mocking sections, unreadable test cases and scenarios, the need to know the internal implementation of the class, etc.
During this talk we will look at different examples of such issues that good designs should avoid. We will also look where does a bad design lead.
Array Basics
Copying Arrays
Passing Arrays to Methods
Returning an Array from a Method
(Optional) Variable-Length Argument Lists
The Arrays Class
Two-Dimensional Arrays
(Optional) Multidimensional Arrays
Fundamentals of Database Systems Questions and AnswersOXUS 20
Fundamentals of Database Systems questions and answers with explanation for fresher's and experienced for interview, competitive examination and entrance test.
Java GUI PART III is the continues of JAVA GUI PART I and II covering and discussing the GUI components with events and events handling as for instance Action Event, Mouse Event, Key Event, etc...
Java GUI PART II is the continues of JAVA GUI PART I covering and discussing the GUI components as well as the different available Layout Managers which is available in JAVA and you can find dedicated example for each Layout Managers …
A Graphical User Interface (GUI) is a user interface based on graphics i.e. icons, pictures, menus, etc. instead of just plain text, it uses a mouse as well as a keyboard as an input device.
GUI applications enable the users (especially naive ones) to interact with a system easily and friendly. This presentation is meant for the individual who has little or no experience in Java GUI programming.
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.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
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.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
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.
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.
5. Introduction to Virtual Keyboard
»A virtual keyboard is considered to be a component to use on computers without a real keyboard e.g.
˃touch screen computer
»A mouse can utilize the keyboard functionalities and features.
5
https://www.facebook.com/Oxus20
6. Virtual Keyboard Usage
»It is possible to obtain keyboards for the following specific purposes:
˃Keyboards to fill specific forms on sites
˃Special key arrangements
˃Keyboards for dedicated commercial sites
˃etc.
»In addition, Virtual Keyboard used for the following subjects:
˃Foreign Character Sets
˃Touchscreens
˃Bypass key loggers
6
https://www.facebook.com/Oxus20
8. Exception Handling
»A program can be written assuming that nothing unusual or incorrect will happen.
˃The user will always enter an integer when prompted to do so.
˃There will always be a nonempty list for a program that takes an entry from the list.
˃The file containing the needed information will always exist.
»Unfortunately, it isn't always so.
»Once the core program is written for the usual, expected case(s), Java's exception-handling facilities should be added to accommodate the unusual, unexpected case(s).
8
10. Exception Handling Demo Source code
public class ExceptionHandlingDemo {
public static void main(String args[]) {
try {
int scores[] = { 90, 85, 75, 100 };
System.out.println("Access element nine:" + scores[9]);
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Exception thrown:" + e);
}
System.out.println("nWithout Exception Handling I was not able to execute and print!");
}
}
10
https://www.facebook.com/Oxus20
11. Exception Handling Demo OUTPUT
Exception thrown:java.lang.ArrayIndexOutOfBoundsException: 9
Without Exception Handling I was not able to execute and print!
11
https://www.facebook.com/Oxus20
13. JToggleButton Class
»JToggleButton is an implementation of a two-state button and is used to represent buttons that can be toggled ON and OFF
»The JRadioButton and JCheckBox classes are subclasses of this class.
»The events fired by JToggleButtons are slightly different than those fired by JButton.
13
https://www.facebook.com/Oxus20
14. JToggleButton Demo
»The following example on next slide demonstrates a toggle button. Each time the toggle button is pressed, its state is displayed in a label.
»Creating JToggleButton involves these steps:
1.Create an instance of JToggleButton.
2.Register an ItemListener to handle item events generated by the button.
3.To determine if the button is on or off, call isSelected().
14
https://www.facebook.com/Oxus20
19. Java Robot Class
»This class is used to generate native system input events for the purposes of
˃test automation
˃self-running demos
˃and other applications where control of the mouse and keyboard is needed.
»This class has three main functionalities:
˃mouse control
˃keyboard control
˃and screen capture.
https://www.facebook.com/Oxus20
19
20. Robot Class Demo
»Perform keyboard operation with help of java Robot class.
»The following example on next slide will demonstrate the Robot class usage to handle the keyboard events.
»The program will write the word "OXUS20" inside the TextArea automatically after running the program.
»The word "OXUS20" will be written character by character with one second delay between each on of the characters.
20
https://www.facebook.com/Oxus20
21. Robot Class Demo Source Code
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class RobotDemo extends JFrame {
public RobotDemo() {
// JFrame with TextArea Settings
setTitle("OXUS20 Robot Demo");
setSize(400, 200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
JTextArea txtOXUS = new JTextArea();
add(txtOXUS, BorderLayout.CENTER);
setVisible(true);
}
21
https://www.facebook.com/Oxus20
22. public static void main(String[] args) {
new RobotDemo();
// Store Keystrokes "OXUS20" in an array
int keyInput[] = { KeyEvent.VK_O, KeyEvent.VK_X, KeyEvent.VK_U,
KeyEvent.VK_S, KeyEvent.VK_2, KeyEvent.VK_0 };
try {
Robot robot = new Robot();
// press the shift key
robot.keyPress(KeyEvent.VK_SHIFT);
// This types the word 'OXUS20' in the TextArea
for (int i = 0; i < keyInput.length; i++) {
if (i > 0) {
robot.keyRelease(KeyEvent.VK_SHIFT);
}
robot.keyPress(keyInput[i]);
// pause typing for one second
robot.delay(1000);
}
} catch (AWTException e) {
System.err.println("Exception is happening!");
}
} // end of main()
} // end of RobotDemo class
22
https://www.facebook.com/Oxus20
24. Toolkit class
»Toolkit is an AWT class acting as a base class for all implementations of AWT.
»This class offers a static method getDefaultToolkit() to return a Toolkit object representing the default implementation of AWT.
»You can use this default toolkit object to get information of the default graphics device, the local screen, and other purposes.
»Next slide demonstrate an example finding out the actual size and resolution of your screen.
24
https://www.facebook.com/Oxus20
25. Toolkit Class Demo Source Code
import java.awt.Dimension;
import java.awt.Toolkit;
public class ToolkitDemo {
public static void main(String[] a) {
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
System.out.println("Screen size: " + d.width + "x" + d.height);
System.out.println("nScreen Resolution: " + tk.getScreenResolution());
}
}
25
https://www.facebook.com/Oxus20
27. Another Toolkit Example
»Change the state of the Caps Lock key
˃If Caps Lock key is ON turn it OFF
˃Otherwise, if Caps Lock key is OFF turn it ON
»Toolkit.getDefaultToolkit().setLockingKeyState( KeyEvent.VK_CAPS_LOCK, false);
˃This line of code will change the state of the Caps Lock key OFF.
»Toolkit.getDefaultToolkit().setLockingKeyState( KeyEvent.VK_CAPS_LOCK, true);
˃This line of code will change the state of the Caps Lock key ON.
»Accordingly the keyboard LEDs flash will become ON or OFF.
27
https://www.facebook.com/Oxus20