Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #17638
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail |
|---|---|
| From | "Jeff Higgins" <jeff.higgins@1:261/38.remove-t9h-this> |
| Subject | Re: Layout Doesn't Work |
| Message-ID | <50254C52.56585.calajapr@time.synchro.net> (permalink) |
| X-Comment-To | clusardi2k |
| Newsgroups | comp.lang.java.programmer |
| In-Reply-To | <5022BA90.56387.calajapr@time.synchro.net> |
| References | <5022BA90.56387.calajapr@time.synchro.net> |
| X-FTN-AREA | COMP.LANG.JAVA.PROGRAMMER |
| X-FTN-MSGID | 1:261/38 65815dea |
| X-FTN-REPLY | 1:261/38 b4c1c2c4 |
| Content-Type | text/plain; charset=IBM437 |
| Content-Transfer-Encoding | 8bit |
| X-Gateway | time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] |
| Lines | 83 |
| Date | Fri, 10 Aug 2012 18:39:03 GMT |
| NNTP-Posting-Host | 69.21.70.65 |
| X-Complaints-To | news@tds.net |
| X-Trace | newsreading01.news.tds.net 1344623943 69.21.70.65 (Fri, 10 Aug 2012 13:39:03 CDT) |
| NNTP-Posting-Date | Fri, 10 Aug 2012 13:39:03 CDT |
| Organization | tds.net |
| Xref | csiph.com comp.lang.java.programmer:17638 |
Show key headers only | View raw
To: clusardi2k
From: Jeff Higgins <jeff@invalid.invalid>
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.Timer;
import javax.swing.WindowConstants;
@SuppressWarnings("serial")
public final class Hide_Show_Label_with_Delay extends JFrame {
private final JButton button;
private final JLabel label;
private final Timer timer;
private Hide_Show_Label_with_Delay() {
button = new JButton("Show");
label = new JLabel("Label");
timer = new Timer(3000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
button.setEnabled(true); }});
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (label.isVisible()) {
label.setVisible(false);
button.setText("Show");
button.setEnabled(false);
timer.start();
} else {
label.setVisible(true);
button.setText("Hide");
button.setEnabled(false);
timer.start();
} }});
GroupLayout layout
= new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHonorsVisibility(label, Boolean.FALSE);
layout.setHorizontalGroup(
layout.createSequentialGroup()
.addComponent(button)
.addComponent(label));
layout.setVerticalGroup(
layout.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(button)
.addComponent(label));
pack();
label.setPreferredSize(label.getPreferredSize());
label.setVisible(false);
setVisible(true);
}
public static void main(String args[]) {
final Hide_Show_Label_with_Delay gui
= new Hide_Show_Label_with_Delay();
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
gui.setVisible(true); }});
}
}
--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
jLabel setVisible(true) Doesn't Work "clusardi2k" <clusardi2k@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: jLabel setVisible(true) Doesn't Work "markspace" <markspace@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: jLabel setVisible(true) Doesn't Work "clusardi2k" <clusardi2k@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: jLabel setVisible(true) Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Layout Doesn't Work (was: jLabel setVisible(true) Doesn't Work) "Jeff Higgins" <jeff.higgins@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work (was: jLabel setVisible(true) Doesn't Work) "clusardi2k" <clusardi2k@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "markspace" <markspace@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "clusardi2k" <clusardi2k@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "clusardi2k" <clusardi2k@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "markspace" <markspace@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-r72-this> - 2012-08-08 20:06 +0000
Re: Layout Doesn't Work "clusardi2k" <clusardi2k@1:261/38.remove-r72-this> - 2012-08-08 20:06 +0000
Re: Layout Doesn't Work "markspace" <markspace@1:261/38.remove-k2r-this> - 2012-08-09 18:44 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-t9h-this> - 2012-08-10 18:39 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-t9h-this> - 2012-08-10 18:39 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-6gh-this> - 2012-08-10 19:41 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: Layout Doesn't Work "Jeff Higgins" <jeff.higgins@1:261/38.remove-r72-this> - 2012-08-08 20:06 +0000
Re: jLabel setVisible(true) Doesn't Work "John B. Matthews" <john.b..matthews@1:261/38.remove-qhs-this> - 2012-08-08 19:04 +0000
Re: jLabel setVisible(true) Doesn't Work "Roedy Green" <roedy.green@1:261/38.remove-k2r-this> - 2012-08-09 18:44 +0000
csiph-web