Describe Heavy Weight Components Mean In Java Programming

0 votes
I heard about heavy and light weighted components in swing AWT and containers, could you please elaborate that to me?
Nov 28, 2018 in Java by Neha
• 6,300 points

1 answer to this question.

0 votes
Heavy weight components like Abstract Window Toolkit (AWT), depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button. In this relationship, the Motif button is called the peer to the java.awt.Button. If you create two Buttons, two peers and hence two Motif Buttons are also created. The Java platform communicates with the Motif Buttons using the Java Native Interface.

For each and every component added to the application, there is an additional overhead tied to the local windowing system, which is why these components are called heavyweight.
answered Nov 28, 2018 by Frankie
• 9,810 points

Related Questions In Java

0 votes
1 answer

what do you mean by static block in java?

Static block is used for initializing the ...READ MORE

answered Jun 18, 2018 in Java by scarlett
• 1,290 points
0 votes
1 answer

What does NaN mean in Java?

"NaN" stands for "not a number". "Nan" ...READ MORE

answered Jul 12, 2018 in Java by Akrati
• 960 points
0 votes
1 answer

How to get the windows native look in Java GUI programming?

Hello Kartik,  You can try the syntax: UIManager.setLookAndFeel(PLAF); (Pluggable ...READ MORE

answered May 7, 2020 in Java by Niroj
• 82,880 points
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 51,729 views
0 votes
1 answer

revalidate() vs repaint() in Java Swing

You need to call repaint() and revalidate() both in order ...READ MORE

answered Sep 20, 2018 in Java by code.reaper12
• 3,500 points
0 votes
1 answer

Fetching screen resolution using Java

You can fetch the screen resolution using the Toolkit.getScreenSize() method ...READ MORE

answered Sep 20, 2018 in Java by anto.trigg4
• 3,440 points
0 votes
1 answer

How to run Unix shell script from Java code?

ProcessBuilder pb = new ProcessBuilder("", "myArg1", "myArg2"); ...READ MORE

answered Oct 26, 2018 in Java by Daisy
• 8,110 points
0 votes
1 answer

How to change selection listener in JComboBox?

It should respond to ActionListeners, like this: combo.addActionListener (new ...READ MORE

answered Nov 15, 2018 in Java by Frankie
• 9,810 points
0 votes
1 answer
0 votes
1 answer

What do you mean by aggregation in Java?

Aggregation is a specialized form of Association ...READ MORE

answered Feb 18, 2019 in Java by Frankie
• 9,810 points