473,750 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relevance of jseparator.reva lidate() statement

anurag275125
79 New Member
Hello Bytes.com members.....

I write a swing program that automatically re-size the separator. But I didn't understand the significance of jseparator.reva lidate() 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 946

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

Similar topics

1
2670
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 you may return to a user. Is there an effective algorithm whereby some normalisation etc. could effectively be used to provide at least a "rough" guide?
1
1946
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. Any snips, ideas or links appreciated. Thanks
0
1329
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 you may return to a user. Is there an effective algorithm whereby some normalisation etc. could effectively be used to provide at least a "rough" guide?
0
1311
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. Any snips, ideas or links appreciated. Thanks
1
6174
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` ) AGAINST ( '+code+nasdac' IN BOOLEAN MODE ) AS SCORE FROM `page` WHERE MATCH ( `title` , `descrip` ) AGAINST ( '+code+nasdac' IN BOOLEAN MODE ); +---------------------------------------------+-----------------+ | title | SCORE |...
1
2450
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 counting the keyword occurences in records with a PHP script somehow and using that to order the records somehow. Or doing a non boolean fulltext search w/relevance first and then melding that in somehow with a boolean search. See my results...
10
1336
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 cadabras over the years. I need the statments for autoexec.bat and config.sys in order to load mscdex.exe. (I know the question in its sheer temerity looks OT. Give me a little rope. MPJ
10
8009
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 "MyVariable". Thanks in advance.
7
5269
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 someone searches for "Italian Food" it's bring back results for other resteraunts that are not italian, but do have the word Food in their keywords. Is there a way of adding relevance to a search, in a way that would make sense for the above senario? ...
1
1597
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 for the page <?php /******************************************************************** MULTIFEEDS TEST PAGE Nothing too exciting here. Just a sample page that demos integrated Multifeeds support as well as cached favicons and perhaps a...
0
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9339
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4713
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.