Sei sulla pagina 1di 6

This section contains the implementation details for different packages and classes of the

rating prediction application. It also contains the coding snippets that help to understand
what a particular section of code represents. The following steps are required to run the
application successfully:
1. Install the NetBeans IDE
2. Import the project file into the NetBeans IDE
3. In the package explorer, run the home.java as a java application

home.java is a client-side implementation and is responsible for displaying the application’s


default main page.

The coding snippet shows the setup of the main default page that contains the application
title and calls the all product items page.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package rating.prediction.based;

/**
*
* @author java1
*/

public class home extends javax.swing.JFrame {

/**
* Creates new form home
*/

public home() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel4 = new javax.swing.JLabel();


jLabel5 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel4.setFont(new java.awt.Font("Bodoni MT Black", 1, 18)); // NOI18N


jLabel4.setText("SENTIMENT FROM TEXTUAL REVIEWS");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(70,
210, 490, 40));
jLabel5.setFont(new java.awt.Font("Bodoni MT Black", 1, 18)); // NOI18
jLabel5.setText("RATING PREDICTION BASED ON SOCIAL ")
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(70,
130, 470, 40));

jButton1.setBackground(new java.awt.Color(153, 153, 0));


jButton1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
jButton1.setText("NEXT");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(460, 313, 80, 30));

jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/rating/prediction/based/bgg.jpg")));
// NOI18N
jLabel1.setText("jLabel1");
getContentPane().add(jLabel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 660, 470));

java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-638)/2, (screenSize.height-500)/2, 638, 500);
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

new allproductitems().setVisible(true);
}

/**
* @param args the command line arguments
*/

public static void main(String args[]) {


/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/

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(home.class.getName()).log(java.util.logging.Level.
SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.
SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.
SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.
SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */

java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new home().setVisible(true);
}
});
}
// Variables declaration - do not modify

private javax.swing.JButton jButton1;


private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;

// End of variables declaration


}
main.java

Potrebbero piacerti anche