Advertisement
deww1

ddd

Aug 6th, 2011
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. /*
  7. * CPLoader.java
  8. *
  9. * Created on Aug 6, 2011, 2:33:42 PM
  10. */
  11.  
  12. /**
  13. *
  14. * @author uj
  15. */
  16. public class CPLoader extends javax.swing.JFrame {
  17.  
  18. /** Creates new form CPLoader */
  19. public CPLoader() {
  20. initComponents();
  21. }
  22.  
  23. /** This method is called from within the constructor to
  24. * initialize the form.
  25. * WARNING: Do NOT modify this code. The content of this method is
  26. * always regenerated by the Form Editor.
  27. */
  28. @SuppressWarnings("unchecked")
  29. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  30. private void initComponents() {
  31.  
  32. jLabel1 = new javax.swing.JLabel();
  33. loadWebsite = new javax.swing.JButton();
  34.  
  35. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  36. setTitle("Rune Resort Control Panel");
  37. setBackground(new java.awt.Color(102, 102, 102));
  38. setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
  39. setName("RRCP"); // NOI18N
  40. setResizable(false);
  41.  
  42. jLabel1.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
  43. jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  44. jLabel1.setText("Rune Resort Client Control Panel");
  45. jLabel1.setName("jLabel1"); // NOI18N
  46.  
  47. loadWebsite.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
  48. loadWebsite.setText("Go to Website");
  49. loadWebsite.setName("loadWebsite"); // NOI18N
  50. loadWebsite.addActionListener(new java.awt.event.ActionListener() {
  51. public void actionPerformed(java.awt.event.ActionEvent evt) {
  52. loadWebsiteActionPerformed(evt);
  53. }
  54. });
  55.  
  56. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  57. getContentPane().setLayout(layout);
  58. layout.setHorizontalGroup(
  59. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  60. .addGroup(layout.createSequentialGroup()
  61. .addContainerGap()
  62. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  63. .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)
  64. .addComponent(loadWebsite, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE))
  65. .addContainerGap())
  66. );
  67. layout.setVerticalGroup(
  68. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  69. .addGroup(layout.createSequentialGroup()
  70. .addContainerGap()
  71. .addComponent(jLabel1)
  72. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  73. .addComponent(loadWebsite, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
  74. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  75. );
  76.  
  77. pack();
  78. }// </editor-fold>
  79.  
  80. private void loadWebsiteActionPerformed(java.awt.event.ActionEvent evt) {
  81. sendToURL("http://www.runeresort.com/");
  82. }
  83.  
  84. // /**
  85. // * @param args the command line arguments
  86. // */
  87. // public static void main(String args[]) {
  88. // java.awt.EventQueue.invokeLater(new Runnable() {
  89. // public void run() {
  90. // new CPLoader().setVisible(true);
  91. // }
  92. // });
  93. // }
  94.  
  95. // Variables declaration - do not modify
  96. protected javax.swing.JLabel jLabel1;
  97. protected javax.swing.JButton loadWebsite;
  98. // End of variables declaration
  99.  
  100. public void sendToURL(String url) {
  101. try {
  102. java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
  103. } catch (Exception exception) {
  104. //log("[ERROR]SendToURL: " + exception.getLocalizedMessage());
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement