Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #18254
| From | Knute Johnson <nospam@knutejohnson.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: How to remove line around label image |
| Date | 2012-08-20 13:20 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <k0u672$mi6$1@dont-email.me> (permalink) |
| References | <824fad70-20cf-4b77-a9f1-296f6f1b8449@googlegroups.com> <k0tugm$4ed$1@dont-email.me> <85bbe4c1-ffc8-405f-9fb5-53fb05e4941a@googlegroups.com> |
On 8/20/2012 12:11 PM, clusardi2k@aol.com wrote:
>> On Monday, August 20, 2012 2:09:26 PM UTC-4, Knute Johnson wrote:
>> We need to see some code. I don't see the problem you describe in the code
>> below. Are you using AWT?
>
> Here is code that yields a tiny line around the image.
>
> public class Line extends javax.swing.JFrame
> {
> public Line()
> {
> initComponents();
> }
>
> @SuppressWarnings("unchecked")
> // <editor-fold defaultstate="collapsed" desc="Generated Code">
> private void initComponents() {
>
> jLabel1 = new javax.swing.JLabel();
>
> setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
> setBackground(new java.awt.Color(51, 0, 153));
> setForeground(java.awt.Color.orange);
>
> jLabel1.setText("Remove Tiny Line");
>
> javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
> getContentPane().setLayout(layout);
> layout.setHorizontalGroup(
> layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
> .addGroup(layout.createSequentialGroup()
> .addGap(149, 149, 149)
> .addComponent(jLabel1)
> .addContainerGap(150, Short.MAX_VALUE))
> );
> layout.setVerticalGroup(
> layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
> .addGroup(layout.createSequentialGroup()
> .addGap(116, 116, 116)
> .addComponent(jLabel1)
> .addContainerGap(168, Short.MAX_VALUE))
> );
>
> pack();
> }// </editor-fold>
>
>
> public static void main(String args[])
> {
> try
> {
> for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
> {
> if ("Nimbus".equals(info.getName()))
> {
> javax.swing.UIManager.setLookAndFeel(info.getClassName());
>
> break;
> }
> }
> } catch (ClassNotFoundException ex) {
> java.util.logging.Logger.getLogger(Line.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
> } catch (InstantiationException ex) {
> java.util.logging.Logger.getLogger(Line.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
> } catch (IllegalAccessException ex) {
> java.util.logging.Logger.getLogger(Line.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
> } catch (javax.swing.UnsupportedLookAndFeelException ex) {
> java.util.logging.Logger.getLogger(Line.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
> }
> //</editor-fold>
>
> java.awt.EventQueue.invokeLater(new Runnable()
> {
>
> public void run()
> {
> new Line().setVisible(true);
> }
> });
> }
> // Variables declaration - do not modify
> private javax.swing.JLabel jLabel1;
> // End of variables declaration
>
> }
>
One other thing to consider is that look and feel must be changed from
the EDT although I don't think that would cause this problem.
--
Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to remove line around label image clusardi2k@aol.com - 2012-08-20 10:18 -0700
Re: How to remove line around label image Knute Johnson <nospam@knutejohnson.com> - 2012-08-20 11:09 -0700
Re: How to remove line around label image clusardi2k@aol.com - 2012-08-20 12:11 -0700
Re: How to remove line around label image Knute Johnson <nospam@knutejohnson.com> - 2012-08-20 13:14 -0700
Re: How to remove line around label image clusardi2k@aol.com - 2012-08-21 05:28 -0700
Re: How to remove line around label image Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-21 09:16 -0400
Re: How to remove line around label image clusardi2k@aol.com - 2012-08-21 10:49 -0700
Re: How to remove line around label image Knute Johnson <nospam@knutejohnson.com> - 2012-08-21 08:34 -0700
Re: How to remove line around label image Knute Johnson <nospam@knutejohnson.com> - 2012-08-20 13:20 -0700
Re: How to remove line around label image Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-20 14:16 -0400
csiph-web