Swing is the primary Java GUI widget toolkit. It is part of Oracle's Java Foundation Classes (JFC) — an API for providing a graphical user interface (GUI) for Java programs.

Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT). Swing provides a native look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform. It has more powerful and flexible components than AWT. In addition to familiar components such as buttons, check boxes and labels, Swing provides several advanced components such as tabbed panel, scroll panes, trees, tables and lists.

Unlike AWT components, Swing components are not implemented by platform-specific code. Instead they are written entirely in Java and therefore are platform-independent. The term "lightweight" is used to describe such an element.


More Links

engrjawad commented: Nice Info +0

You have to change your key listener from Released to Pressed. Reason is on release it check so your characters go out of range. Hope this help.

 public void keyPressed(KeyEvent key)

for checking strings use equal function. == sign doesnt work properly while checking strings.

E.g String a  = "hello";
    a.equal("hello"); // ---- true ----------------

Better check the documentations for these warnings.

This error is because of serializable class. You have two ways to eliminate this

1) Give it a ID
private static final long serialVersionUID = any_Id;

2) If you using eclipse then use
@SuppressWarnings("serial") // this anotation will disable the warning because of serial.

vinnitro commented: thnx for helping it worked +2

If you are using JDK 1.7.0 then you have to use generic type as stated in its documentation

You wont find that problem in 1.6.

there is no need for OR operator.... use this

    //-------- use to upper function to make it in one case and equal to compare them.
    // Above is java syntax i hope there will be same in c#

echo your $name, also paste your url address here, seems like you are not passing correctly the name parameter.

There is no way u can do this.... You can create ur own title bar by overiding the original title bar. All you have to do is setUndecorated(true). This will remove title bar and you can place your custom title bar.

JakeA commented: thanks... how can i create a titlebar with the same look and feel as windows? +0

I think you are confused in passing a class as a paramater,
You can pass class as a paramater...

Lets Take an example

//----------- Class a -----------------
class a
    private int i;
    a(int j)
        i = j;

    public void print()

//----------------- Class b
class b
        b(a A)

//---------------- Main Class which is controlling the other classes    
public class c
    public static void main(String args[])
            b B1  = new b(new a(10));
            b B2  = new b(new a(10));

Here i have taken two class a and b, while c is only for central controlling the two. b class constructor takes a class parameter and print it in the constructor.

DavidKroukamp commented: docs solve them all :) +8

First of all you dont have Card Class, thats why it is giving cant find symbol error.
Second you cant call non-static objects from static functions because static has more life then non static thats why compiler stops you from doing this.

Thats what is pointed in this link... You need a manifest file.
1) Create a text file name manifest
2) write -> Main Class: your mainclass name where your main function resides
3)goto cmd and write jar -cvfm manifest.txt yourjarname.jar yourclasses.class

I atleast earn a point for this... :)

this page explains every thing you require.

I have given you a hint to reach your goal. I cant solve all of your problem by pasting code. Its against the rule of this forum. In the above code i provided you a way to do some task over that strings which dont have p. So you simply need a method which counts string letter.

String s = "i am a p";
if(s.indexOf("p") == -1) //Index of method checks wether the character is present or not
    methodForCountingAllAlphabet(s); // count if p is not present
    continue(); // leave the string if p is present. This all the logic u require.

Your Problem : Scope of variable "i" is only to loop.
Try to declare a variable before for loop and use it inside for statement.

int i;

Do you have idea of creating manifest file?

 Your problem:new ImageIcon [] = getClass().getResource(name[0])
 What are u doing here...
 Solution: new ImageIcon(getClass().getResource(name[0]))
 Image Icon takes a parameter and that the image location.
 Hope this Help..

Grid Layout set the layout in the form of Rows and columns , there are no options for setting the content size... Better move to Grid Bag Layout, it is the most flexiable one with size and placement options.

are u using two different pc's?

I think you want to get the current salary of the user when u change the combo box value, try read this article
Make a method which on change or selected values in combo box search the file for the specified value and place it on the textfield.

Hope this helps....

Majestics 84 Posting Pro

Is there any way to extend gaps between jmenuitem?

Seems like u want to abort a thread cleanly if it fails to complete in a desired time. I think "interrupt" is one of the possible way's, u need a exception handler in which u can print a message or empty as u desire....

Reduce the number of column from 50 to 30....
incoming = new JTextArea(15, 30);

Your Text is appearing but isnt adjusting over frame correctly...

So where is the code............... Its a easy assignement
scanner class for input through console mode
JOptionPane input dialogue box for input through GUI
code after creating a bit logic and submit here... We will help you further...

mKorbel commented: right +9

You have written a wrong function

public String toString(){//to string summerizing all the inputs on output.
return ("The date you have enterd is : " + this.month +", " + this.day+", " + this.year);

1) as this.month function prints the integer value
2) you must use setMonth(month) function to print the month....
3) Also i think you have to modify your function of setMonth(month) because its not efficient, because when you are using switch then you can use default statement, there is no need to use if statement here.

Well according to my opnion better practice will be making a textfield and a small beautiful button with it. Disable text field. When the user press the button the message box display and ask for data and display it in textfield...
And i think you need confirmation box , not the messagebox.

//------------- Write your code here
catch(Exceptiontype object)
//--------- What will happen when error generate.

Generally u can use "Exception" to handle all kinds of exception but its not a proper way because you cant understand different type of exception then... Search down exception type in documentation and implement them.

there is no need to mention auto increment explicitly , it will increment automatically when ever you insert a new row

further more the query must be like this
insert into Confirm(columnname) values(columnvalue)

Hope this Help......

nagatron commented: nice job. . I never thought my problem would be that easy. .hehe thank you +3

I think u made new id after getting banned onlineshade... Still i dont have any concernd with it...
If you want to run this application then u must have java ee configured or with java se u have to download api regarding to javax.mail from oracle website and provide the application at buildpath...