Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Animated Alphabets display

  Asked By: Mona    Date: Dec 26    Category: Java    Views: 1227
  

I have an urgent question.
i am building a graphical user interface.
For the display above progress bar
i have downloaded some animated icons which contains
Animated Alphabets
Please Wait
Now main problem is this, when i display them, some of them
appear and some of them dont appear at all, then when i again
run them sometimes full alphabets display.

import javax.swing.* ;
import java.awt.* ;
import java.awt.event.*;

public class Ali2 extends JFrame
{

private JButton b[] = new JButton[6] ;
private JButton b1[] = new JButton[4] ;

public Ali2()
{
super("Demonstrating BoxLayout");
final int SIZE = 6 ;
final int SIZE1 = 4;
Container c = getContentPane();
c.setLayout( new BorderLayout( 30, 30 ) );

Box box[] = new Box[4] ;
b[0] = new JButton( new ImageIcon("images3/p.gif") );
b[1] = new JButton( new ImageIcon("images3/l.gif" ));
b[2] = new JButton( new ImageIcon("images3/e.gif"));
b[3] = new JButton( new ImageIcon("images3/a.gif"));
b[4] = new JButton( new ImageIcon("images3/s.gif"));
b[5] = new JButton( new ImageIcon("images3/e.gif"));

b1[0] = new JButton( new ImageIcon("images2/w.gif"));
b1[1] = new JButton( new ImageIcon("images2/a.gif"));
b1[2] = new JButton( new ImageIcon("images2/i.gif"));
b1[3] = new JButton( new ImageIcon("images2/t.gif"));

box[0] = Box.createHorizontalBox();
box[1] = Box.createHorizontalBox();
box[2] = Box.createHorizontalBox();
box[3] = Box.createHorizontalBox();


for( int i = 0 ; i < SIZE ; i++ )
{
box[0].add( Box.createHorizontalGlue() );
box[0].add( b[i] );
}

for( int j = 0 ; j < SIZE1 ; j++ )
{
box[1].add( Box.createHorizontalGlue());
box[1].add( b1[j] );
}

c.add( box[0], BorderLayout.NORTH );
c.add( box[1], BorderLayout.CENTER );
setSize( 600, 400 );
show();
}

public static void main( String args[] )
{
Ali2 app = new Ali2();
app.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent e )
{
System.exit( 0 );
}
}
);
}
}

May be there is some problem regarding Screen resolutoin, can
someone tell me why it is not supporting the animated icons and why
dont they display properly.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Animated Alphabets display Or get search suggestion and latest updates.




Tagged: