Does Swing contains any heavy weight component?

Answer Posted / karthik

Yes ok

Example:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class xx extends JFrame
{

xx()
{
Container con=getContentPane();
//this Heavy weight component Button
con.add(new Button("hhhhhhhhhhhhhhhhh"));
setVisible(true);
setSize(200,300);
}
public static void main(String aa[])
{
new xx();
}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by java swing?

699


Why should the implementation of any swing callback (like a listener) execute quickly?

730


What is the what is the difference between invokeandwait() and invokelater()? ?

837


What is an event in Swing?

780


Is swing part of core java?

744


What is the difference between applications and applets?

797


Why are swing components called lightweight?

714


What is import javax swing in java?

716


How does accessibility works in swings?

717


What is the relationship between clipping and repainting?

848


Which is better swing or awt?

703


Is javafx better than swing?

715


How to reload a jframe in java swing?

763


What is the role of java swing?

694


Which method is used for setting security in applets?

799