473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Relevance of jseparator.revalidate() statement

anurag275125
Hello Bytes.com members.....

I write a swing program that automatically re-size the separator. But I didn't understand the significance of jseparator.revalidate() line in the code.
here is the code..........

Expand|Select|Wrap|Line Numbers
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. /* <applet
  5. code=resize_separator.class
  6. width=600
  7. height=600
  8. >
  9. </applet> */
  10. public class resize_separator extends JApplet implements ComponentListener
  11. {
  12.     JSeparator js=new JSeparator(JSeparator.VERTICAL);
  13.     Dimension d=js.getPreferredSize();
  14.     public void init()
  15.     {
  16.         Container c=getContentPane();
  17.         c.setLayout(new FlowLayout());
  18.         c.add(new JTextField("Hello from swing!",30));
  19.         c.add(js);
  20.         c.add(new JTextField("Hello from swing!",30));
  21.         addComponentListener(this);
  22.     }
  23.     public void componentShown(ComponentEvent e)
  24.     {
  25.         js.setPreferredSize(new Dimension(d.width,getSize().height));
  26.         js.revalidate();       // please explain the line
  27.     }
  28.     public void componentResized(ComponentEvent e)
  29.     {
  30.         js.setPreferredSize(new Dimension(d.width,getSize().height));
  31.         js.revalidate();
  32.     }
  33.     public void componentMoved(ComponentEvent e){}
  34.     public void componentHidden(ComponentEvent e){}
  35. }
  36.  
can you please explain the statement??

thanks....
Feb 15 '10 #1
0 936

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ap49 | last post by:
Hi, I've just started to implement a FULLTEXT search script in PHP. I have read that the relevance rating should not directly be used to create a rating (as a percentage say) for the results...
1
by: Hal Halloway | last post by:
How do I change a MYSQL Fulltext relevance value to: 0 to 100%. I'm just thinking about usability for the "average" user - maybe they would like to know...and would not understand the raw value. ...
0
by: ap49 | last post by:
Hi, I've just started to implement a FULLTEXT search script in PHP. I have read that the relevance rating should not directly be used to create a rating (as a percentage say) for the results...
0
by: Hal Halloway | last post by:
How do I change a MYSQL Fulltext relevance value to: 0 to 100%. I'm just thinking about usability for the "average" user - maybe they would like to know...and would not understand the raw value. ...
1
by: leegold | last post by:
Given the SQL shouldn't the records be sorting by score ie. relevance? I thought if "WHERE MATCH" is used it will sort that way. Thanks mysql> SELECT `page`.`title` , MATCH ( `title` , `descrip`...
1
by: leegold | last post by:
Show full header Is there any way to make relevance when using boolean mode more useful? If not, are there plans in the Fulltext development "todo" for making it useful? I'm thinking of just...
10
by: Merrill & Michele | last post by:
Elsethread is a discussion of identifiers. How many times have you had to wipe out a HD and start over. I just thought of a way to keep gcc running all the time here, but I've forgotten my abra...
10
by: Vinod I | last post by:
Hi Team, I just want to know, wat is the relevance /or benefit of using "_" before a variable. i.e., if I use a variable as "_MyVariable", wat benefit I am going to achieve than just using...
7
gregerly
by: gregerly | last post by:
Hello, I've got a problem with a website search function. PHP for the front end, MySQL for the backend. The search function searches a field of keywords. The problem I'm having is that when...
1
by: ojsimon | last post by:
Hi I Am using Simplepie to display some rss feeds, currently it displays them in date and time order but i want it to display them in relevance order by using a usort function. here is the code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.