Eclipse Trouble importing javax.swing.j anything

L

leveda007

I am using eclipse and when i try to import

import javax.swing.JFrame

It give me a "cannot resolve JFrame" error.
Is there something in need to set before being able to use Jbutton,
JFrame.. ect.?
 
S

siva.a22

hi leveda,

It will not be the problem to me. Just i tried out ur
requirement. i will send u small code.just try it out. once u paste
this code, u can understand the program very easily.enjoy....


import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

import sun.security.krb5.internal.crypto.f;

/**
*
*/

/**
* @author sivakumar
*
*/
public class JFrameTest extends JFrame {

public static void main(String s[]){
JFrameTest frameTest=new JFrameTest();
frameTest.setLayout(new BorderLayout());
JButton button=new JButton("Ok");
button.setSize(100,200);
frameTest.add(button,BorderLayout.EAST);

frameTest.pack();
frameTest.setSize(200,300);
frameTest.show();

}

}


Thanks & Regards,
Siva Kumar A
D03118
Java Team
 
M

Mahesh

I hope u had the right code!

So to resolve the problem,

You will have the project properties. I mean a set of properties having
configuration for the project. Like classpath,src diretory,...

All you have to do is to select the Jframe speccific jars(check from
eclipse manual). Add them to the project properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top