Posts

Showing posts from March, 2011

Example of Breadth Search

Image
Here is a tree the root is 1. and the goals are 9,10,11,12 Queue = Q ----------------------------------------------------------------------- 1 2 ----------------------------------------------------------------------- At the first movement State = 1 ( is state is our goal  :::::::: Not ) Sucessor of state is added in Queue form Back   ( Q = 2 3 4 ) then state = queue[0] = 2 remove first item form queue. ( Q = 3 4 ) State = 2 ( is state is our goal  :::::::: Not ) Sucessor of state is added in Queue form    ( Q = 3 4 5 6 ) then state = queue[0] = 3 remove first item form queue. ( Q = 4 5 6 ) State = 3 ( is state is our goal  :::::::: Not ) Sucessor of state is added in Queue form Front   ( Q = 4 5 6 ) then state = queue[0] = 4 remove first item form queue. ( Q = 5 6 ) State = 4 ( is state is our goal  :::::::: Not ) Sucessor of state is added in Queue form Front   ( Q = 5 6 7 8 ) then state = queue[0] = 5 remove first item form ...

Java Localization

Intelligent Programmer------> To translate a text in to a particular language is know as  Localization.  It is a process by which we can change a text to a different language and also we can add some   locale-specific components. Swing  supports localization in the way that when we localize an application to a particular language and run it in that specific locale then Swing pulls up the localized strings from the  resource bundle.  After this,  the  component  gets resized  by the  layout manager.  The previous example demonstrates how to localize an application. Undo Framework API To perform  undo  and  redo,  the developers can use   Swing's undo framework.  There are number of actions related to undo and redo which are supported by Swing. Moreover, it can easily be used with any other application such as if you want to undo the  add and remove elements from a table,  you can easil...

Java Internationalization

Intelligent Programmer-----> Swing in Java also supports the feature of  Internationalization.  The developers can build applications by which the users can interact worldwide in  different languages. They can also create applications that can accept input in languages having different characters such as  French, Spanish, Japanese,  etc.   An  automatic support  is provided by the Swing's layout managers  required by the UI.  That is Swing's layout manager let the UI to appear from  right to left in a locale.  Hence to let the UI work for left to right and right to left and also to take care of the size of components that change on localization, you need to code the UI only once. Lets see how to  internationalize  the program given below. import java.util.*; public class InternationalizationDemo {     public static void main(String[] args) {         ...

Java Data Transfer

Image
Intelligent Programmer-----> Swing supports data transfer through  drag and drop, copy-paste, cut-paste  etc.  Data transfer  works between  Swing components within an application and between Java and native applications. The ability of data transfer is beneficial to programs  between Java applications, between components etc. There are two ways to transfer data. These are: 1.  The diagram below displays the  Drag and drop (DnD)  functionality of Swing.  2.   The diagram below displays the  cut/copy and paste  functionality of Swing.  That is the clipboard transfer  via cut/copy and paste. The path of the data is shown by the arrows. To be more precise, first of all the  bundling of data  takes place into a  package  known as Transferable  to begin  Data Transfer.  Then the data gets extracted by an object i.e. TransferHandler   from the Transferable  which i...

Java 2D API

Image
Intelligent Programmer-----> Programming has become more interactive with  Java 2D API.  You can add  images, figures, animation  to your  GUI  and even pass visual information with the help of Java 2D API. You can easily use 2D within Swing components such as  drop shadows  since Swing is built on 2D package. Pluggable Look and Feel  The Java Swing supports the  plugging between the look and feel  features. The look and feel that means the dramatically changing in the component like  JFrame, JWindow, JDialog  etc. for viewing it into the several types of window. You can create your own look and feel using  Synth package.  There are many of existing look and feels which are available to Swing programs provided by  GTK+ look and feel.  Moreover, the look and feel of the platform  can be specified by the program while running and also to use Java look and feel can be specified by it. The  ...

Java Swing Components

Intelligent Programmer--->Lets now see what's Swing? Well, Swing is important to develop Java programs with a  graphical user interface (GUI).  There are many components which are used for the building of GUI in Swing. The  Swing Toolkit consists of many components for the building of GUI. These components are also helpful in providing  interactivity to Java applications.  Following are components which are included in Swing toolkit: list controls buttons labels tree controls table controls All  AWT  flexible components can be handled by the  Java Swing.  Swing toolkit contains far more components than the simple component toolkit. It is unique to any other toolkit in the way that it supports   integrated internationalization,   a highly customizable text package, rich undo support  etc. Not only this you can also  create your own look and feel using Swing  other than the ones that are supported by it. The cu...