NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package game;

import java.awt.Color;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

public class OptionFrame extends javax.swing.JFrame {

String difficulties[][] =
{
{"/game/easy_round.gif" ,null},
{"/game/normal_round.gif" ,null},
{"/game/hard_round.gif" ,null},
};

String icons[][] =
{
{"/game/ez_round.gif" ,null},
{"/game/normal_round.gif", null},
{"/game/hard_round.gif" ,null}
};

String[] txt = { "", "", "d" };

JLabel[] lbls = new JLabel[3];

public OptionFrame() {
initComponents();
getContentPane().setBackground(new Color(70, 80, 70));

ez.setName("0");
jLabel2.setName("1");
jLabel3.setName("2");

lbls[0] = ez;
lbls[1] = jLabel2;
lbls[2] = jLabel3;

for (int i = 0; i < 3; i++)
{
lbls[i].setSize(150,150);
lbls[i].setHorizontalAlignment(SwingConstants.CENTER);
lbls[i].setVerticalAlignment(SwingConstants.CENTER);
}
}

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
jMenu5 = new javax.swing.JMenu();
jButton3 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
ez = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu6 = new javax.swing.JMenu();
jMenu7 = new javax.swing.JMenu();

jMenu1.setText("jMenu1");

jMenu2.setText("jMenu2");

jMenu3.setText("jMenu3");

jMenu4.setText("jMenu4");

jMenu5.setText("jMenu5");

jButton3.setText("HURT ME PLENTY");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton1.setText("NIGHTMARE!");

setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("MEMENTO");
setBackground(new java.awt.Color(40, 89, 240));

jButton4.setText("TOP SCORES");

ez.setIcon(new javax.swing.ImageIcon(getClass().getResource("/game/ez_round_13.gif"))); // NOI18N
ez.setText("jLabel1");
ez.setMaximumSize(new java.awt.Dimension(150, 150));
ez.setMinimumSize(new java.awt.Dimension(150, 150));
ez.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
showInfo(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
showIcon(evt);
}
});

jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/game/normal_round.gif"))); // NOI18N
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
showInfo(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
showIcon(evt);
}
});

jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/game/hard_round.gif"))); // NOI18N
jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
showInfo(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
showIcon(evt);
}
});

jMenuBar1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(153, 153, 255), new java.awt.Color(153, 0, 204), null, null));

jMenu6.setBorder(new javax.swing.border.MatteBorder(null));
jMenu6.setText("Options");
jMenuBar1.add(jMenu6);

jMenu7.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jMenu7.setText("Help");
jMenuBar1.add(jMenu7);

setJMenuBar(jMenuBar1);

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(27, 27, 27)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(50, 50, 50)
.addComponent(ez, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(70, 70, 70)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
.addComponent(jLabel3)
.addGap(38, 38, 38))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(67, 67, 67)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ez, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
.addComponent(jButton4)
.addGap(34, 34, 34))
);

pack();
}// </editor-fold>

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void showInfo(java.awt.event.MouseEvent evt) {

int ndx = new Integer(((JLabel)evt.getSource()).getName());
lbls[ndx].setIcon(new ImageIcon(this.getClass().getResource(difficulties[ndx][0])));
lbls[ndx].setText("");
}

private void showIcon(java.awt.event.MouseEvent evt) {
int ndx = new Integer(((JLabel)evt.getSource()).getName());
lbls[ndx].setIcon(new ImageIcon(this.getClass().getResource(icons[ndx][0])));
lbls[ndx].setText("");
}


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(OptionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(OptionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(OptionFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(OptionFrame.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 OptionFrame().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JLabel ez;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenu jMenu6;
private javax.swing.JMenu jMenu7;
private javax.swing.JMenuBar jMenuBar1;
// End of variables declaration
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.