I can't get this to paint.

Hi, I am trying to get this create a new panel. And in that panel, I am trying to have some credits paint. I have not been able to get this to do anything more than give me an error (java.lang.NoSuchMethodError: main Exception in thread "main" ) or working but not displaying anything...
Can you help me by giving me some code help or pointing me in the correct direction.
Thanks
package RPGGame;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import java.net.*;
public class Main extends javax.swing.JFrame {
/** Creates new form Main */
int screen = 0;
//MidiClip creditss = new MidiClip();
Credits Credits;
boolean credits = false;
Image back;
Graphics gr;
public Main() {
initComponents();
initComponents2();
resize(750,750);
* WARNING: Do NOT modify this code.
private void initComponents() {//GEN-BEGIN:initComponents
titleBack = new javax.swing.JLabel();
aboutPanel = new javax.swing.JPanel();
aboutPanelOK = new javax.swing.JButton();
menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu();
newMenuItem = new javax.swing.JMenuItem();
openMenuItem = new javax.swing.JMenuItem();
saveMenuItem = new javax.swing.JMenuItem();
exitMenuItem = new javax.swing.JMenuItem();
helpMenu = new javax.swing.JMenu();
contentsMenuItem = new javax.swing.JMenuItem();
aboutMenuItem = new javax.swing.JMenuItem();
getContentPane().setLayout(null);
setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
setFont(new java.awt.Font("Bookman Old Style", 0, 10));
setMaximizedBounds(new java.awt.Rectangle(25, 25, 750, 750));
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
titleBack.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
titleBack.setIcon(new javax.swing.ImageIcon("BackGround.GIF"));
titleBack.setText(" ");
titleBack.setBorder(new javax.swing.border.MatteBorder(null));
getContentPane().add(titleBack);
titleBack.setBounds(0, 0, 750, 730);
aboutPanel.setLayout(null);
aboutPanel.setBackground(new java.awt.Color(0, 0, 0));
aboutPanel.setBorder(new javax.swing.border.MatteBorder(null));
aboutPanel.setForeground(new java.awt.Color(255, 0, 0));
aboutPanelOK.setBackground(new java.awt.Color(0, 0, 0));
aboutPanelOK.setForeground(new java.awt.Color(255, 0, 0));
aboutPanelOK.setText("OK");
aboutPanelOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutPanelOKActionPerformed(evt);
aboutPanel.add(aboutPanelOK);
aboutPanelOK.setBounds(289, 310, 75, 26);
getContentPane().add(aboutPanel);
aboutPanel.setBounds(50, 150, 650, 350);
menuBar.setBackground(new java.awt.Color(0, 0, 0));
menuBar.setForeground(new java.awt.Color(0, 255, 0));
menuBar.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent evt) {
menuBarComponentResized(evt);
fileMenu.setBackground(new java.awt.Color(0, 0, 0));
fileMenu.setForeground(new java.awt.Color(0, 255, 0));
fileMenu.setText("File");
fileMenu.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fileMenuActionPerformed(evt);
newMenuItem.setBackground(new java.awt.Color(0, 0, 0));
newMenuItem.setForeground(new java.awt.Color(0, 255, 0));
newMenuItem.setText("New Game");
newMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
newMenuItemActionPerformed(evt);
fileMenu.add(newMenuItem);
openMenuItem.setBackground(new java.awt.Color(0, 0, 0));
openMenuItem.setForeground(new java.awt.Color(0, 255, 0));
openMenuItem.setText("Load Game");
openMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openMenuActionPerformed(evt);
fileMenu.add(openMenuItem);
saveMenuItem.setBackground(new java.awt.Color(0, 0, 0));
saveMenuItem.setForeground(new java.awt.Color(0, 255, 0));
saveMenuItem.setText("Save Game");
saveMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveMenuItemActionPerformed(evt);
fileMenu.add(saveMenuItem);
exitMenuItem.setBackground(new java.awt.Color(0, 0, 0));
exitMenuItem.setForeground(new java.awt.Color(0, 255, 0));
exitMenuItem.setText("Exit");
exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitMenuItemActionPerformed(evt);
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setBackground(new java.awt.Color(0, 0, 0));
helpMenu.setForeground(new java.awt.Color(0, 255, 0));
helpMenu.setText("Help");
contentsMenuItem.setBackground(new java.awt.Color(0, 0, 0));
contentsMenuItem.setForeground(new java.awt.Color(0, 255, 0));
contentsMenuItem.setText("Contents");
contentsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
contentsMenuItemActionPerformed(evt);
helpMenu.add(contentsMenuItem);
aboutMenuItem.setBackground(new java.awt.Color(0, 0, 0));
aboutMenuItem.setForeground(new java.awt.Color(0, 255, 0));
aboutMenuItem.setText("About");
aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutMenuActionPerformed(evt);
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
setJMenuBar(menuBar);
pack();
}//GEN-END:initComponents
private void aboutPanelOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutPanelOKActionPerformed
aboutPanel.setVisible(false);
}//GEN-LAST:event_aboutPanelOKActionPerformed
private void initComponents2() {//second part of initComponents
aboutPanel.setVisible(false);
back = createImage(650,350);
gr = back.getGraphics();
Credits = new Credits(gr, back);
private void aboutMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuActionPerformed
aboutPanel.setVisible(true);
Credits.paintCredits();
}//GEN-LAST:event_aboutMenuActionPerformed
private void saveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveMenuItemActionPerformed
// Add your handling code here:
}//GEN-LAST:event_saveMenuItemActionPerformed
private void fileMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fileMenuActionPerformed
// Add your handling code here:
}//GEN-LAST:event_fileMenuActionPerformed
private void openMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuActionPerformed
// Add your handling code here:
}//GEN-LAST:event_openMenuActionPerformed
private void contentsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_contentsMenuItemActionPerformed
// Add your handling code here:
}//GEN-LAST:event_contentsMenuItemActionPerformed
private void menuBarComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_menuBarComponentResized
// Add your handling code here:
}//GEN-LAST:event_menuBarComponentResized
private void newMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newMenuItemActionPerformed
// Add your handling code here:
}//GEN-LAST:event_newMenuItemActionPerformed
private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
System.exit(0);
}//GEN-LAST:event_exitMenuItemActionPerformed
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
System.exit(0);
}//GEN-LAST:event_exitForm
* @param args the command line arguments
public static void main(String args[]) {
new Main().show();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem aboutMenuItem;
private javax.swing.JPanel aboutPanel;
private javax.swing.JButton aboutPanelOK;
private javax.swing.JMenuItem contentsMenuItem;
private javax.swing.JMenuItem exitMenuItem;
private javax.swing.JMenu fileMenu;
private javax.swing.JMenu helpMenu;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenuItem newMenuItem;
private javax.swing.JMenuItem openMenuItem;
private javax.swing.JMenuItem saveMenuItem;
private javax.swing.JLabel titleBack;
// End of variables declaration//GEN-END:variables
package RPGGame;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import java.net.*;
public class Credits {
FontMetrics fm;
Image[] menu=new Image[4];
int xDraw = 650;
int yDraw = 200;
Shape oldclip;
Image back;
Graphics gr;
String[] text = new String[14];
public Credits(Graphics abc, Image cba) {
text[0]="RPG Game";
     text[1]="________________________";
     text[2]="";
     text[3]="Head Programmer";
     text[4]="________________________";
     text[5]="Matt Schott";
     text[6]="";
     text[7]="Looser #1";
     text[8]="________________________________";
     text[9]="Kyle";
     text[10]="";
     text[11]="Looser #2";
     text[12]="___________________________________";
     text[13]="Andy";
gr = abc;
back = cba;
public void paintCredits() {
     gr.drawString(text[0], xDraw, yDraw);
     gr.drawString(text[1], xDraw, yDraw-5);
     gr.drawString(text[2], xDraw, yDraw-10);
     gr.drawString(text[3], xDraw, yDraw-15);
     gr.drawString(text[4], xDraw, yDraw-20);
     gr.drawString(text[5], xDraw, yDraw-25);
     gr.drawString(text[6], xDraw, yDraw-30);
     gr.drawString(text[7], xDraw, yDraw-35);
     gr.drawString(text[8], xDraw, yDraw-40);
     gr.drawString(text[9], xDraw, yDraw-45);
     gr.drawString(text[10], xDraw, yDraw-50);
     gr.drawString(text[11], xDraw, yDraw-55);
     gr.drawString(text[12], xDraw, yDraw-60);
     gr.drawString(text[13], xDraw, yDraw-65);
}

This thread should get you started:
http://forum.java.sun.com/thread.jsp?forum=31&thread=452259
However, an easier way to create an About panel is to create a bunch of labels and add them to the panel. This way you don't have to worry about positioning them and sizing your dialog.

Similar Messages

Maybe you are looking for

  • Help!!! Ipod not recognised!

    Hey I have an ipod nano that is not being recognised by itunes!!! I've been following the web sites instructions but itunes still doesn't recognise it. WHAT SHOULD I DO?????

  • HT4113 please help disabled ipod and it says connect to itunes but itunes cant connect due to password

    been working for 4 hours to get this thing to work.

  • Link iPad to tv with ios6

    Does anyone know if you can link an iPad or iPhone to a television after updating to ios6?

  • About JTable.

    Hello , Can anyone please give me a hint on how to use the ResultSet to populate the JTable from the database , I have my ResultSet ready but I'm confused about how to use it , do I have to create a String Array to hold each row , and another to hold

  • Initialisation data load failure

    Hi all, My initialisation data load for 0EC_PCA_3 failed with an error message "Selected No does not agree with transferred no." , the data processing is ok. I am pasting the shrot dump from the source system below. Error analysis