Month: August 2015
-
CheckboxGroups
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– CheckboxGroups.java /./././././././././ ///////////////////// import java.applet.Applet; import java.awt.*; //////////////////// public class CheckboxGroups extends Applet { public void init() { setLayout(new GridLayout(4, 2)); setBackground(Color.lightGray); setFont(new Font(“Serif”, Font.BOLD, 16)); add(new Label(“Flavor”, Label.CENTER)); …
-
A textfield and three buttons arranged by a verticle BoxLayout
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– BoxLayoutTest.java A textfield and three buttons arranged by a verticle BoxLayout. Uses WindowUtilities.java and ExitListener.java. ################## import java.awt.*; import java.awt.event.*; import javax.swing.*; /** An example of BoxLayout. * *********** public class BoxLayoutTest extends JPanel implements…
-
Implementation of a simple browser in Swing (The user can specify a URL to load into the browser (JEditorPane))
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Browser.java Implementation of a simple browser in Swing. The user can specify a URL to load into the browser (JEditorPane). By attaching an Hyperlink Listener, the editor pane is responsive to hyperlinks selected by the user.…
-
A simple applet (JApplet) created in Swing.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; import javax.swing.*; /** Tiny example showing the main differences in using * JApplet instead of Applet: using the content pane, * getting Java (Metal) look and feel by default, and * having BorderLayout be…
-
Illustrates the insertion of menu entries in Frame menu bars.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ************** ColorMenu.java ************** import java.awt.*; import java.awt.event.*; /** Illustrates the insertion of menu entries in Frame * menu bars. * public class ColorMenu extends CloseableFrame implements ActionListener { private String[] colorNames…
-
JTable Examples
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– # JTableSimpleExample.java Simple table that takes column names and data from arrays of Strings. import java.awt.*; import javax.swing.*; /** Simple JTable example that uses a String array for the * table header and table data. *…
-
Eight buttons: four each in two panels
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– mport java.applet.Applet; import java.awt.*; *************************** /** Eight buttons: four each in two panels. * */ public class ButtonTest2 extends Applet { public void init() { String[] labelPrefixes = { “Start”, “Stop”, “Pause”, “Resume” }; Panel p1…
-
JList Examples
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– All examples, except for FileTransfer use WindowUtilities.java and ExitListener.java. WindowUtilities.java: import javax.swing.*; import java.awt.*; // For Color and Container classes. /** A few utilities that simplify using windows in Swing. * */ public class WindowUtilities…
-
Position circles down the diagonal so that their borders
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; import java.applet.Applet; /** Position circles down the diagonal so that their borders * just touch. Illustrates that AWT components are * rectangular and opaque. */ public class CircleTest2 extends Applet { public…
-
Insert three circles into an Applet using FlowLayout
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; import java.applet.Applet; /** Insert three circles into an Applet using FlowLayout. * */ public class CircleTest extends Applet { public void init() { setBackground(Color.lightGray); add(new Circle(Color.white, 30)); add(new Circle(Color.gray, 40));…
-
Message.java Applet that reads customization parameters from an HTML file
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ******************* Message.java Applet that reads customization parameters from an HTML file ******************* import java.applet.Applet; import java.awt.*; **************** public class Message extends Applet { private int fontSize; private String message; public void…
-
Accesses methods in a Ship2 object
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ********************************************* Test2.java Accesses methods in a Ship2 object ********************************************* // Give the ship public move and printLocation methods. class Ship2 { public double x=0.0, y=0.0, speed=1.0, direction=0.0; public String name = “UnnamedShip”; private…
-
Placement of buttons in a BoxLayout using rigid areas, struts, and glue
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ############### InvisibleComponentTest.java Placement of buttons in a BoxLayout using rigid areas, struts, and glue ############### import java.awt.*; import javax.swing.*; import javax.swing.border.*; /** Example of using rigid areas, struts, and glue to * produce the effect of…
-
Adds typing to the freehand drawing.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.applet.Applet; import java.awt.*; import java.awt.event.*; /** A better whiteboard that lets you enter * text in addition to freehand drawing. * ****************** public class Whiteboard extends SimpleWhiteboard { protected FontMetrics fm; public…
-
java Nested container where the top-level panels are positioned by hand
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ###################### ButtonCol.java Nested container where the top-level panels are positioned by hand ###################### import java.applet.Applet; import java.awt.*; /** An example of a layout performed manually. The top-level * panels are positioned by hand, after you determine…
-
Layout of complicated GUI by taking advantage of nested containers
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ################# NestedLayout.java Layout of complicated GUI by taking advantage of nested containers. Uses WindowUtilities.java and ExitListener.java. ################## import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; /** An example demonstrating the use of…
-
A demo providing multiple buttons to select a playing card-A Panel, using CardLayout control which of four possible subpanels, holding a different card, to display
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ####################### # CardDemo.java A demo providing multiple buttons to select a playing card. A Panel, using CardLayout control which of four possible subpanels, holding a different card, to display.Uses the following class and images: *…
-
BorderLayout divides the window into five regions
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– # BorderTest.java Five buttons arranged by BorderLayout BorderLayout divides the window into five regions: NORTH, SOUTH, EAST, WEST, and CENTER. /./././././././././././././ import java.applet.Applet; import java.awt.*; /** An example of BorderLayout. * &&&&&&&&&&&&&&&&&&&&&&&&&&& public class BorderTest extends…
-
Checkboxes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Checkboxes.java Inherits from CloseableFrame.java. ****************** import java.awt.*; /./././././././././ public class Checkboxes extends CloseableFrame { public static void main(String[] args) { new Checkboxes(); } public Checkboxes() { super(“Checkboxes”); setFont(new Font(“SansSerif”, Font.BOLD,…
-
Places a Panel holding 100 buttons in a ScrollPane
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.applet.Applet; import java.awt.*; /** Places a Panel holding 100 buttons in a ScrollPane that is * too small to hold it. * */ public class ScrollPaneTest extends Applet { public void init() {…
-
Five buttons arranged by FlowLayout
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– FlowTest.java ************* FlowTest.java Five buttons arranged by FlowLayout By default, FlowLayout arranges components in rows, left to right, and centered. /././././././././././././ import java.applet.Applet; import java.awt.*; /** FlowLayout puts components in rows. * ************************************ public class FlowTest…
-
A Frame that lets you draw circles with mouse clicks
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– SavedFrame.java **************** A Frame that lets you draw circles with mouse clicks //************** import java.awt.*; import java.awt.event.*; import java.io.*; /** A Frame that lets you draw circles with mouse clicks * and then save the Frame…
-
FrameExample1.java and 2
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ****************** # FrameExample1.java ****************** import java.awt.*; /** */ public class FrameExample1 { public static void main(String[] args) { Frame f = new Frame(“Frame Example 1”); f.setSize(400, 300); f.setVisible(true); } } *********************…
-
ThreadedRSAKey.java Illustrates converting a method in an existing class from a single-threaded method to a multi-threaded method.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ThreadedRSAKey.java Illustrates converting a method in an existing class from a single-threaded method to a multi-threaded method. In this example, RSAKey computes an RSA public-private key pair, where the key size has a specified number of…
-
Eight ungrouped buttons in an Applet using FlowLayout
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– mport java.applet.Applet; import java.awt. *; ************************** /** Eight ungrouped buttons in an Applet using FlowLayout. * */ public class ButtonTest1 extends Applet { public void init() { String[] labelPrefixes = { “Start”, “Stop”, “Pause”, “Resume” };…
-
A Circle component built using a Canvas
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; /** A Circle component built using a Canvas. * */ public class Circle extends Canvas { private int width, height; public Circle(Color foreground, int radius) { setForeground(foreground);…
-
Simplifies the setting of native look and feel
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– WindowUtilities.java Simplifies the setting of native look and feel. #################### import javax.swing.*; import java.awt.*; // For Color and Container classes. /** A few utilities that simplify using windows in Swing. * ################### public class WindowUtilities {…
-
Using the this reference in class Ship3
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– /./././././././././. // Give Ship3 a constructor to let the instance variables // be specified when the object is created. /./././././././././ class Ship3 { public double x, y, speed, direction; public String name; public…
-
DashedStrokeExample.java Draws a circle with a dashed line segment (border). Inherits from FontExample.java.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– >>>>>>>>>>>>>>>>> import java.awt.*; /** An example of creating a custom dashed line for drawing. * ********************* public class DashedStrokeExample extends FontExample { public void paintComponent(Graphics g) { clear(g); Graphics2D g2d = (Graphics2D)g; …
-
draws a circle wherever mouse was pressed
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– CircleListener.java A subclass of MouseAdapter that draws a circle wherever mouse was pressed. Illustrates first approach to event-handling with listeners: attaching a separate listener *********** import java.applet.Applet; import java.awt.*; import java.awt.event.*; /** The listener used by…
-
Six buttons arranged in a 2 row x 3 column grid by GridLayout
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– /././././././ GridTest.java Six buttons arranged in a 2 row x 3 column grid by GridLayout.GridLayout divides the window into equal-sized rectangles based upon the number of rows and columns specified. ****************** import java.applet.Applet; import java.awt.*; /**…
-
ListEvent2.java
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– # ListEvents.java Uses the following classes: * CloseableFrame.java * SelectionReporter.java * ActionReporter.java /././././././././././././ import java.awt.event.*; /././././././ public class ListEvents2 extends ListEvents { public static void main(String[] args) { new ListEvents2(); …
-
A Frame that can actually quit
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; import java.awt.event.*; /** A Frame that you can actually quit. Used as the starting * point for most Java 1.1 graphical applications. * public class CloseableFrame extends Frame { public CloseableFrame(String title) {…
-
creating a simple Swing application using a JFrame
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– JFrameExample.java Demonstrates creating a simple Swing application using a JFrame. As with a JApplet, components must be added to the content pane, instead of the window directly.import java.awt.*; import javax.swing.*; /** Tiny example showing the main…
-
Explicit placement of five buttons with the layout manager turned off
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– NullTest.java Explicit placement of five buttons with the layout manager turned off (set to null) ########################## import java.applet.Applet; import java.awt.*; /** Layout managers are intended to help you, but there * is no law saying you…
-
JTree Examples
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– SimpleTree.java Basic tree built out of DefaultMutableTreeNodes. A DefualtMutableTreeNode is a starting point for a root node, in which children nodes can be added. import java.awt.*; import javax.swing.*; import javax.swing.tree.*; /** Example tree built out of…
-
Printing in Java 2
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– * o PrintExample.java Demonstrates printing a Graphics2D object. import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.awt.print.*; /** An example of a printable window in Java 1.2. The key point * here is that any…
-
BetterCircleTest.java
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ********************** BetterCircleTest.java ********************** import java.awt.*; import java.applet.Applet; /** Position circles down the diagonal so that their borders * just touch. Illustrates that Java 1.1 lightweight * components can be partially transparent. * */ public class…
-
RMI Example – Numerical Integration, a more realistic RMI example that sends an evaluatable object (function) from a client to a server for numerical integration.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Integral.java Performs actual numerical integration of the function (evaluatable object). /** A class to calculate summations and numeric integrals. The * integral is calculated according to the midpoint rule. * * Taken from Core Web Programming…
-
A JPanel that displays six radio buttons with labels.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– A JPanel that displays six radio buttons with labels. import java.awt.*; import javax.swing.*; /** A JPanel that displays six JRadioButtons. * *. */ public class SixChoicePanel extends JPanel { public SixChoicePanel(String title, String[] buttonLabels) {…
-
ThreadedEchoServer.java A multithreaded version of EchoServer, where each client request is serviced on a separate thread. Requires the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.net.*; import java.io.*; /** A multithreaded variation of EchoServer. * * Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * . * © 2001 Marty Hall and Larry Brown; * …
-
Implementing a Server : Network Server
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– NetworkServerTest.java Establishes a network Server that listens for client requests on the port specified (command-line argument). Uses the following classes: /** Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * …
-
UrlTest.java Demonstrates the ease in which the various components of an URL can be determined (host, port, protocol, etc.)
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– জা import java.net.*; /** Read a URL from the command line, then print * the various components. * * Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * . * ©…
-
Counter2Test.java Driver class that creates three threaded objects (Counter2) that count from 0 to 4.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– /** Try out a few instances of the Counter2 class. Driver class that creates three threaded objects (Counter2) that count from 0 to 4. In this case, the driver does not start the threads, as each…
-
Template illustrating the first approach for creating a class with thread behavior.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ** Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * © 2001 Marty Hall and Larry Brown; * may be freely used or adapted. */ public class ThreadClass extends Thread…
-
Creates three radio buttons and illustrates handling
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– JRadioButtonTest.java Creates three radio buttons and illustrates handling ItemEvents in response to selecting a radio button. import javax.swing.JRadioButton; import javax.swing.ButtonGroup; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** */ public class JRadioButtonTest extends JPanel implements ItemListener…
-
Simple button that the user can select to load the entered URL.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– JIconButton.java A simple button that the user can select to load the entered URL. import javax.swing.*; /** A regular JButton created with an ImageIcon and with borders * and content areas turned off. * */…
-
A simple button that contains an image and a label for use in a toolbar
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ToolBarButton.java A simple button that contains an image and a label for use in a toolbar. import java.awt.*; import javax.swing.*; /** Part of a small example showing basic use of JToolBar. * The point here is…
-
Demonstrates the use of a JColorChooser which presents a dialog with three different tabbed panes to allow the user to select a color preference
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Demonstrates the use of a JColorChooser which presents a dialog with three different tabbed panes to allow the user to select a color preference. The dialog returns a Color object based on the user’s selection or…
-
Creates various buttons. In Swing
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; import javax.swing.*; /** Simple example illustrating the use of JButton, especially * the new constructors that permit you to add an image. * */ public class JButtons extends JFrame { public static…
-
Multithreaded Graphics and Double Buffering
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ShipSimulation.java Illustrates the basic approach of multithreaded graphics whereas a thread adjusts parameters affecting the appearance of the graphics and then calls repaint to schedule an update of the display. import java.applet.Applet; import java.awt.*; public…
-
Driver class that creates three threaded objects (Counter2) that count from 0 to 4.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– /** Try out a few instances of the Counter2 class. public class Counter2Test { public static void main(String[] args) { Counter2 c1 = new Counter2(5); Counter2 c2 = new Counter2(5); Counter2 c3…
-
Template illustrating the second approach for creating a class with thread behavior.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Template illustrating the second approach for creating a class with thread behavior. In this case, the class implements the Runnable interface while providing a run method for thread execution. public class ThreadedClass extends AnyClass implements Runnable…
-
Creates and starts three threaded objects
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Creates and starts three threaded objects which count from 0 to 4. Uses the following class: CounterTest.java Counter.java /** Try out a few instances of the Counter class. public class CounterTest { public static void main(String[]…
-
DOM example that represents the basic structure of an XML document as a JTree
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– //XMLTree.java //Uses the following files Uses the following files: * XMLFrame.java:Swing application to select an XML document and display in a JTree. ExtensionFileFilter.java Allows you to specify which file extensions will be displayed in a…
-
Simple example illustrating the use of check boxes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– JCheckBoxTest.java Simple example illustrating the use of check boxes. import javax.swing.*; import java.awt.event.*; */ public class JCheckBoxTest extends JPanel implements ItemListener, ActionListener{ JCheckBox checkBox1, checkBox2; public JCheckBoxTest() { checkBox1…
-
Basic tool bar for holding multiple buttons.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– BrowserToolBar.java A basic tool bar for holding multiple buttons. import java.awt.*; import javax.swing.*; /** Part of a small example showing basic use of JToolBar. * Creates a small dockable toolbar that is supposed to look * …
-
Demonstrates the use of a JColorChooser which presents a dialog with three different tabbed panes to allow the user to select a color preference
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Demonstrates the use of a JColorChooser which presents a dialog with three different tabbed panes to allow the user to select a color preference. The dialog returns a Color object based on the user’s selection or…
-
WebClient – Client application that can talk interactively to Web servers. Requires the components listed below
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.awt.*; // For BorderLayout, GridLayout, Font, Color. import java.awt.event.*; import java.util.*; import javax.swing.*; /** A graphical client that lets you interactively connect to * Web servers and send custom request lines and * request headers.…
-
EchoServer.java A simple HTTP server that creates a Web page showing all data sent from the client (browser), including all HTTP request headers sent form the client. Uses the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– EchoServer.java A simple HTTP server that creates a Web page showing all data sent from the client (browser), including all HTTP request headers sent form the client. Uses the following classes: import java.net.*; import java.io.*;…
-
StoppableThread.java A template to place a thread in a RUN, WAIT, or STOP state.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– /** A template to control the state of a thread through setting * an internal flag. public class StoppableThread extends Thread { public static final int STOP = 0; public static final int RUN …
-
mall example showing the basic use of a JToolBar
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– mall example showing the basic use of a JToolBar import java.awt.*; import javax.swing.*; import java.awt.event.*; /** Small example showing basic use of JToolBar. * * */ public class JToolBarExample extends JFrame implements ItemListener { …
-
UrlRetriever2.java Illustrates how the URL class can simplify communication to an HTTP server.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– UrlRetriever2.java Illustrates how the URL class can simplify communication to an HTTP server. import java.net.*; import java.io.*; /** Read a remote file using the standard URL class * instead of connecting explicitly to the HTTP server.…
-
RMI Example – Message, illustrates retrieving a message from an object located on a remote server. Requires the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Rem.java Establishes which methods the client can access in the remote object. import java.rmi.*; /** The RMI client will use this interface directly. The RMI * server will make a real remote object that implements this,…
-
Creates three common types of sliders
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Creates three common types of sliders: one without tick marks, one with tick marks, and one with both tick marks and labels. import java.awt.*; import javax.swing.*; /** Simple example illustrating the use of JSliders, especially * …
-
Basic Swing Details
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– WindowUtilities.java Utility class that simplifies creating a window and setting the look and feel. ExitListener.java A WindowListener with support to close the window. JAppletExample.java A simple applet (JApplet) created in Swing. Illustrates setting the look and…
-
UrlRetriever.java Accepts an URL from the command line, parses the host, port, and URI components from the URL and then retrieves the document. Requires the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– UrlRetriever.java Accepts an URL from the command line, parses the host, port, and URI components from the URL and then retrieves the document. Requires the following classes: import java.util.*; /** This parses the input to get…
-
AddressVerifier.java Connects to an SMTP server and issues a expn request to display details about a mailbox on the server. Uses the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.net.*; import java.io.*; /** Given an e-mail address of the form user@host, * connect to port 25 of the host and issue an * ‘expn’ request for the user. Print the results. * * Taken…
-
Buggy Counter Applet.java Demonstrates that data shared by multiple threads is candidate for a potential race condition
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– import java.applet.Applet; import java.awt.*; /** Emulates the Counter and Counter2 classes, but this time * from an applet that invokes multiple versions of its own run * method. This version is likely to work correctly * …
-
SplitTest.java Illustrates parsing a string with a String.split
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– SplitTest.java Illustrates parsing a string with a String.split /** Prints the tokens resulting from treating the first * command-line argument as the string to be tokenized * and the second as the delimiter set. Uses *…
-
TokTest.java Illustrates parsing a string with a StringTokenizer.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– TokTest.java Illustrates parsing a string with a StringTokenizer. import java.util.StringTokenizer; /** Prints the tokens resulting from treating the first * command-line argument as the string to be tokenized * and the second as the delimiter set.…
-
কীবোর্ড থেকে একটি কী হারিয়ে গেলে বা নষ্ট হয়ে গেলে কি করবেন?
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– আপনার ল্যাপটপের একটি বা একাধিক কী হারিয়ে গেছে বা নষ্ট হয়ে গেছে এবং আপনি জানেন না এখন কি করবেন? ভয় পাবার কিছু নেই, সম্ভবত আপনি কীবোর্ডটি ঠিক করতে পারবেন এবং নতুন একটি কীবোর্ড ক্রয় করার কোন…
-
NetworkClientTest.java Makes a simple connection to the host and port specified on the command line. Uses the following classes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– NetworkClientTest.java Makes a simple connection to the host and port specified on the command line. Uses the following classes: /** Make simple connection to host and port specified. * * Taken from Core Web Programming from…
-
ShowSession.java Servlet that uses session tracking to determine if the client is a repeat visitor. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ShowSession.java Servlet that uses session tracking to determine if the client is a repeat visitor. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*;…
-
LongLivedCookie.java Subclass of Cookie that automatically sets the max age to one year.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– LongLivedCookie.java Subclass of Cookie that automatically sets the max age to one year. package cwp; import javax.servlet.http.*; /** Cookie that persists 1 year. Default Cookie doesn’t * persist past current session. * * Taken from…
-
SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– SearchEngines.java Servlet that redirects requests to various search engines. Uses the SearchSpec helper class. Accessed by means of SearchEngines.html. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; /** Servlet that takes a search string,…
-
EncodedPage.java Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– EncodedPage.java Servlet that shows the bandwidth benefits of gzipping pages to browsers that can handle gzip. Uses the ServletUtilities class to simplify the DOCTYPE and HEAD output. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import…
-
PrimeNumbers.java Servlet that processes a request to generate n prime numbers, each with at least m digits. If these results are not complete, it sends a Refresh header instructing the browser to ask for new results a little while later. Uses the Primes
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– PrimeNumbers.java Servlet that processes a request to generate n prime numbers, each with at least m digits. If these results are not complete, it sends a Refresh header instructing the browser to ask for new results…
-
ShowRequestHeaders.java Servlet that shows all request headers sent by browser in current request.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ShowRequestHeaders.java Servlet that shows all request headers sent by browser in current request. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; /** Shows all the request headers sent on this request. * * Taken…
-
ServletUtilities.java Utility class that, among other things, contains the static filter method that replaces special HTML characters with their HTML character entities.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ServletUtilities.java Utility class that, among other things, contains the static filter method that replaces special HTML characters with their HTML character entities. package cwp; import javax.servlet.*; import javax.servlet.http.*; /** Some simple time savers. Note that most…
-
এসকিউএল কুইজ । SQL Quiz
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science–
-
ThreeParams.java Servlet that reads and displays three request (form) parameters. Uses the ServletUtilities class.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ThreeParams.java Servlet that reads and displays three request (form) parameters. Uses the ServletUtilities class. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet that reads three parameters from the * form data. * …
-
ShowMessage.java Servlet that demonstrates the use of initialization parameters.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ShowMessage.java Servlet that demonstrates the use of initialization parameters. Remember that, to use this servlet, you have to do three things: * Put the modified web.xml file in the WEB-INF directory. * Restart the…
-
ServletUtilities.java Utility class that simplifies the output of the DOCTYPE and HEAD in servlets, among other things. Used by most remaining servlets in the chapter.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ServletUtilities.java Utility class that simplifies the output of the DOCTYPE and HEAD in servlets, among other things. Used by most remaining servlets in the chapter. package cwp; import javax.servlet.*; import javax.servlet.http.*; /** Some simple time savers.…
-
SimplerHelloWWW.java Servlet that uses ServletUtilities to simplify the generation of the DOCTYPE and HEAD part of the servlet.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– SimplerHelloWWW.java Servlet that uses ServletUtilities to simplify the generation of the DOCTYPE and HEAD part of the servlet. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet that generates HTML. This variation of * …
-
HelloWWW.java Servlet that generates HTML. This and all remaining servlets are in the cwp package and therefore should be installed in the cwp subdirectory.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– HelloWWW.java Servlet that generates HTML. This and all remaining servlets are in the cwp package and therefore should be installed in the cwp subdirectory. package cwp; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet that…
-
HelloWorld.java Simple servlet that generates plain text.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– HelloWorld.java Simple servlet that generates plain text. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Very simplistic servlet that generates plain text. * * Taken from Core Web Programming Java 2 Edition * from Prentice Hall…
-
ServletTemplate.java Starting point for servlets.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– ServletTemplate.java Starting point for servlets. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Servlet template. * * Taken from Core Web Programming Java 2 Edition * from Prentice Hall and Sun Microsystems Press, * . * …
-
StringBean.java Bean used to demonstrate jsp:useBean, etc. Remember to install it in the WEB-INF/classes/cwp directory.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– StringBean.java Bean used to demonstrate jsp:useBean, etc. Remember to install it in the WEB-INF/classes/cwp directory. package cwp; /** A simple bean that has a single String property * called message. * <P> * Taken from Core…
-
PHP Exception Handling
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– This post will be publish soon………..
-
PluginApplet.jsp Page that demonstrates the use of jsp:plugin.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– PluginApplet.jsp Page that demonstrates the use of jsp:plugin. Requires you to compile and install PluginApplet.java, TextPanel.java, DrawingPanel.java, and WindowUtilities.java Since these are classes sent to the client to used by applets, the .class files should be…
-
জেকুয়েরী কুইজ । jQuery Quiz
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science–
-
PHP Filters Advanced
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Coming soon………….
-
Razor syntax and MVC application demo
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Razor syntax and MVC application demo
-
BGColor.jsp Page that demonstrates JSP scriptlets. Uses the JSP-Styles style sheet.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– BGColor.jsp Page that demonstrates JSP scriptlets. Uses the JSP-Styles style sheet. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> <!– Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, .…
-
Excel.jsp Page that demonstrates the use of JSP to build Excel spreadsheets
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Excel.jsp Page that demonstrates the use of JSP to build Excel spreadsheets First Last Email Address Marty Hall hall@corewebprogramming.com Larry Brown brown@corewebprogramming.com Bill Gates gates@sun.com Larry Ellison ellison@microsoft.com <%@ page contentType=”application/vnd.ms-excel” %> <%– There are tabs,…
-
Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet.
Huge Sell on Popular Electronics Subscribe to Our Youtube Channel –|–Our Online Shop:ShopForSoul–|Get Trained in AI, Big-Data, Data Science– Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> <!– Example of JSP Expressions. Taken from Core Web Programming Java 2 Edition from Prentice Hall…