06 Aug 2008 @ 6:37 PM 
 

AdsPanel video, add banners, logo’s and links to any Java Swing application!

 


1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
855 views

A Java component I made that you can use to add banners, logo's, animated gifs, links etc to any Java Swing application. I hope you like my Java component! It's free and the old version can be download here on the blog! (I'll upload the latest version later when I have the time)

Oh yeah, the quality of the video is below average (you can't see what i type) but I blame windows movie maker (and youtube for lowering the quality but atleast they are hosting my video)!

//edit
Higher quality video can be downloaded here: http://www.megaupload.com/nl/?d=FSAO2SF5

The code that I used in my demo video


JAVA:
  1. public class Main {
  2. public static void main(String[] args) {
  3. Demo4 D4 = new Demo4();
  4. D4.main(null);
  5.  
  6. Demo2 D2 = new Demo2();
  7. D2.main(null);
  8. }
  9. }

JAVA:
  1. /*--------------------------------------------------------------------------
  2. Demo4 class
  3. *****************
  4. By: HappyFace   http://www.engineeringserver.com
  5. Contact:        info [@] engineeringserver.com
  6. Version:        unknown
  7. Last updated:   06/August/2008
  8. "*****************
  9. Note:
  10. //----------------------------------------------------------------------*/
  11. import java.awt.event.ActionEvent;
  12. import java.awt.event.ActionListener;
  13. import javax.swing.JButton;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16. import javax.swing.JOptionPane;
  17. import javax.swing.JPasswordField;
  18. import javax.swing.JTextField;
  19.  
  20. import engineeringservercomUtilityPackage.AdsPanel;
  21.  
  22. public class Demo4 extends JFrame implements ActionListener{
  23. AdsPanel cb2 = new AdsPanel();
  24. AdsPanel cb1 = new AdsPanel();
  25.  
  26. JLabel nameLbl = new JLabel("Name: ");
  27. JTextField nameTf = new JTextField();
  28. JLabel passwordLbl = new JLabel("Password: ");
  29. JLabel lostPasswordLbl = new JLabel("Lost password?");
  30. JPasswordField passwordTf = new JPasswordField();
  31. JButton submitBtn = new JButton("Submit");
  32.  
  33. public static void main(String[] args){
  34. Demo4 m = new Demo4();
  35. //AdsPanel cb1 = new AdsPanel();
  36. //cb1.copyRight();
  37. m.showGui();
  38. }
  39.  
  40. public void showGui(){
  41. setTitle("Demo: 4 - www.engineeringserver.com");
  42.  
  43. cb2.setBanner("http://www.engineeringserver.com/Software/banner.gif");
  44. cb2.setBounds(5, 0, 470, 70);
  45.  
  46. add(cb2);
  47. nameLbl.setBounds(7, 77, 105, 21);
  48. add(nameLbl);
  49.  
  50. nameTf.setBounds(105, 77, 371, 21);
  51. add(nameTf);
  52.  
  53. passwordLbl.setBounds(7, 105, 105, 21);
  54. add(passwordLbl);
  55.  
  56. cb1.setBounds(290, 140, 100, 20);
  57. cb1.setLink("Lost password?","http://www.engineeringserver.com/pass.txt", 0 ,0,255);
  58. add(cb1);
  59.  
  60. passwordTf.setBounds(105, 105, 371, 21);
  61. add(passwordTf);
  62.  
  63. submitBtn.setBounds(399, 133, 77, 28);
  64. submitBtn.addActionListener(this);
  65. add(submitBtn);
  66.  
  67. setLayout(null);
  68. setDefaultCloseOperation(EXIT_ON_CLOSE);
  69. setLocationRelativeTo(null);
  70. setSize(500, 200);
  71. setResizable(false);
  72. setVisible(true);
  73. }
  74.  
  75. public void actionPerformed(ActionEvent e) {
  76. if(nameTf.getText().equals("HappyFace") && passwordTf.getText().equals("12345")){
  77. JOptionPane.showMessageDialog(this,"This demo will now close","Correct!", JOptionPane.INFORMATION_MESSAGE);
  78. System.exit(0);
  79. }
  80. else{
  81. JOptionPane.showMessageDialog(this,"Please try again","Wrong password", JOptionPane.ERROR_MESSAGE);
  82. }
  83. }
  84. }

JAVA:
  1. /*--------------------------------------------------------------------------
  2. Demo2 class
  3. *****************
  4. By: HappyFace   http://www.engineeringserver.com
  5. Contact:        info [@] engineeringserver.com
  6. Version:        unknown
  7. Last updated:   06/August/2008
  8. "*****************
  9. Note:
  10. //----------------------------------------------------------------------*/
  11. import javax.swing.JFrame;
  12. import javax.swing.WindowConstants;
  13.  
  14. import engineeringservercomUtilityPackage.AdsPanel;
  15.  
  16. public class Demo2 extends JFrame{
  17. AdsPanel cb2 = new AdsPanel();
  18.  
  19. public static void main(String[] args){
  20. Demo2 d2 = new Demo2();
  21. d2.showGui();
  22. //AdsPanel cb1 = new AdsPanel();
  23. //cb1.copyRight();
  24. }
  25.  
  26. public void showGui(){
  27. try {
  28. setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
  29. getContentPane().setLayout(null);
  30. {
  31. cb2.setBanner("http://www.freemyspacegraphics.com/Graphics/Funny_Animations/images/funny_new_46.gif"
  32. , "http://engineeringserver.com");
  33. setTitle("Demo2 - www.engineeringserver.com");
  34. getContentPane().add(cb2);
  35. cb2.setBounds(7, 7,280,300);
  36. }
  37.  
  38. setLocationRelativeTo(null);
  39. setSize(300, 300);
  40. setResizable(false);
  41. setVisible(true);
  42. } catch (Exception e) {
  43. e.printStackTrace();
  44. }
  45. }
  46. }

Related posts

Your Ad Here
Tags Tags: ,
Categories: Java
Posted By: HappyFace
Last Edit: 22 Nov 2008 @ 05 06 PM

EmailPermalink
 

Responses to this post » (2 Total)

 
  1. [...] supports (colored) links as well and optimized the code. A video demo can be seen here + download Engineeringserver.com | AdsPanel video, add banners, logo’s and links to any Java Swing application! ps dont mind the popup, i needed to put that there as per requirement from one of the sponsers of [...]

  2. [...] in any java application this is your lucky day because you can download my adspanel software here: Engineeringserver.com | AdsPanel video, add banners, logo’s and links to any Java Swing application! comes with a demo video that shows how it works. __________________ Java open source software [...]

Post a Comment

You must be logged in to post a comment.

\/ More Options ...
Change Theme...
  • Users » 888
  • Posts/Pages » 1,444
  • Comments » 506
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Online Users



    No Child Pages.

Forum



    No Child Pages.