Array of buttons help please

Hi,I'm creating a calendar/diary program and i need help with the following:
I have 3 classes. One called Calendar_Notetaker.java. This one is the main applet class. The other called MonthDate.java. This class figures out the number of days in month, leap year ect. using the java.util.date. Then another class called CalendarPanel.java. This class creates the actual caladar.
I used a button array to print the days. However i'm having problems accessing the buttons. i need to put an actionlister on them so when a user clicks on them it opens a new window. i know how to open a new window from a button but i cant figure out how to do it from a button array. Do i need need to create an instance from the main applet or can i do it in the class that generates the buttons?
here are my classes..note these are all in sepearte files.
any suggestions would be appreciated
thanks
Kevin
PS. These were done in Borland Jbuilder 7 Enterprise
package calendar_notetaker;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Calendar_NoteTaker extends Applet {
private int currentYear;
private int currentMonth;
private MonthDate myMonth;
CalendarPanel monthPanel;
private boolean isStandalone = false;
//Get a parameter value
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
//Construct the applet
public Calendar_NoteTaker() {
//Initialize the applet
public void init() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
//Component initialization
private void jbInit() throws Exception {
setLayout(new BorderLayout());
myMonth = new MonthDate();
currentYear = myMonth.getYear();
currentMonth = myMonth.getMonth() + 1;
monthPanel = new CalendarPanel(myMonth);
add("Center", monthPanel);
Panel panel = new Panel();
panel.add(new Button("Previous Year"));
panel.add(new Button("Previous Month"));
panel.add(new Button("Next Month"));
panel.add(new Button("Next Year"));
add("South", panel);
show();
public void setNewMonth()
myMonth.setMonth(currentMonth - 1);
myMonth.setYear(currentYear);
monthPanel.showMonth();
public boolean action(Event event, Object obj)
if(event.target instanceof Button)
if("Previous Month".equals(obj))
if(--currentMonth < 1)//goes before january
currentYear--;
currentMonth = 12;
if(currentYear < 70)//year < 1970
currentYear = 70;
} else
if("Next Month".equals(obj))
if(++currentMonth > 12)//if you go past 12 months
currentYear++;//set to next year
currentMonth = 1;//set back to january
if(currentYear > 137)//137 years from current year.
currentYear = 137;
} else
if("Previous Year".equals(obj))
if(--currentYear < 70)
currentYear = 70;
} else
if("Next Year".equals(obj) && ++currentYear > 137)
currentYear = 137;
setNewMonth();
return true;
//Start the applet
public void start() {
//Stop the applet
public void stop() {
//Destroy the applet
public void destroy() {
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
//Get parameter info
public String[][] getParameterInfo() {
return null;
package calendar_notetaker;
import java.awt.*;
import java.util.Date;
public class CalendarPanel extends Panel
private MonthDate myMonth;
Label lblMonth;//month label
Button MonthButtons[];//button arrary for month names
public CalendarPanel(MonthDate monthdate)
lblMonth = new Label("",1);//0 left 1 midele 2 right side
MonthButtons = new Button[42];//42 buttons 7x6 some wont be used
myMonth = monthdate;
setLayout(new BorderLayout());
add("North", lblMonth);
Panel panel = new Panel();
panel.setLayout(new GridLayout(7, 7));//7rows x 7cols
for(int i = 0; i < 7; i++)
panel.add(new Label(MonthDate.WEEK_LABEL));
//0 to 42 monthbuttons above is 42
for(int j = 0; j < MonthButtons.length; j++)
MonthButtons[j] = new Button(" ");
panel.add(MonthButtons[j]);//add the butttons to the panel
showMonth();
add("Center", panel);
show();
public void showMonth()
lblMonth.setText(myMonth.monthYear());//monthyear is built in util.date
int i = myMonth.getDay();//get current day
if(myMonth.weeksInMonth() < 5)//if month has less than 5 weeks
i += 7;//we still want to have a 7x7 grid
for(int j = 0; j < i; j++)
{//add the begging set of empty spaces
MonthButtons[j].setLabel(" ");
MonthButtons[j].disable();
// k<days in month user picks
for(int k = 0; k < myMonth.daysInMonth(); k++)
{//add days in month + empty spaces
MonthButtons[k+ i ].setLabel("" + (k + 1));
MonthButtons[k+ i ].enable();
for(int l = myMonth.daysInMonth() + i; l < MonthButtons.length; l++)
{//add ending number of empty spaces
MonthButtons[l].setLabel(" ");
MonthButtons[l].disable();
package calendar_notetaker;
import java.util.Date;
public class MonthDate extends Date
//week header
public static final String WEEK_LABEL[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
//days in month assuming feburary is not a leap year
final int MonthDays[] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31,
30, 31
//label to print month names
public static final String MONTH_LABEL[] = {
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October",
"November", "December"
//create constructor
public MonthDate()
this(new Date());
public MonthDate(Date date)
{//get the current system date and month add one cause its off one
this(date.getYear(), date.getMonth()+1);
public MonthDate(int year, int monthName)
super(year,monthName-1,1);//year, monthname,start day posistion
public boolean isLeapYear()
int year;
Date date = new Date();
year=date.getYear();
return ( ((year % 4 == 0) && (year % 100 != 0))
|| (year % 400 == 0) );
public int daysInMonth()
int i = getMonth();
if(i == 1 && isLeapYear())
return 29;
} else
return MonthDays;//return the array declared above
public int weeksInMonth()
{ //finds howmany weeks are in a month
return (daysInMonth() + getDay() + 6) / 7;
public String monthLabel()
{ //method to return the month names for printing later
return MONTH_LABEL[getMonth()];
public String monthYear()
{//method to return the month and year for printing later
return monthLabel() + " " + (1900 + getYear());

add a listener and do it from there.

Similar Messages

  • Flash button help PLEASE

    PLEASE HELP ME!!!
    Ok, here is my problem in short. I am fairly competent in
    flash. I am able to export a flash button out in flash 6, but am
    not in flash 8 or 9. The button just turns dead after i upload the
    button into dreamweaver even though its working when i export it
    out in flash.
    I did ALOT of experimenting. The button that was exported out
    in flash 8 or 9 can work with "_blank" but not "_self". I did
    exactly the same thing for flash 6 and it works!!! This is so
    frustrating.
    I was hoping to export it out in flash 8 or 9 because it has
    additional graphics in it.
    Can anyone please tell me what is wrong. THANKS.
    (dead button means when clicked on nothing happens)

    If you want to use Flash for navigation, consider this -
    1. Some people don't have Flash installed - what do they do?
    2. Search engines don't parse Flash links - your site will
    not be spidered
    3. Screen assistive devices don't parse Flash links - what
    will those users
    do?
    4. DW cannot maintain links within a Flash movie, so if you
    move or rename
    a linked file, your navigation will break - what will you do?
    It's usually a very bad idea for these reasons...
    Your link doesn't work.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "reed86" <[email protected]> wrote in
    message
    news:galhtn$7uq$[email protected]..
    > Hi, I would really appreeciate if somebody could help me
    with this really
    > annoying problem,
    >
    > I'm using dreamweaver 8, I have designed a website using
    the dreamweaver
    > flash
    > buttons for my site menu, when I F12 preview the site
    the menu displays
    > fine in
    > both IE6, 7 & Firefox but when I upload my site no
    flash displays at all,
    > this
    > isn't just a problem with the menu buttons it wont
    display ANY swf like
    > mp3
    > players or flash banners.
    >
    > I have uploaded a blank page with just the flash menu
    here:
    >
    >
    http://80.177.175.77/cr/training/index.html
    >
    > if you visit that page it will appear blank, but in the
    source you will
    > see
    > the code for the menu, I have uploaded these two java
    scripts to a folder
    > titles 'Scripts':
    >
    > AC_ActiveX.js
    >
    > AC_RunActiveContent.js
    >
    > I have also uploaded the swf buttons to the main folder.
    >
    > I really don't know what else to do? Any help would be
    greatly appreciated
    >
    > Thanks,
    >
    > Carl
    >

  • GUI array information cycler help please

    I currently have a program that has 3 classes. Basically one class is the main and has some information hard coded that it submits to one of the other classes. The second class takes that information, formats it and sends it to the third class. The third class creates an array, takes the information from the second class and has a display method that the main can call to display the information.
    The program basically spews out all the information in the array in a specific format. The array elements contain strings, ints and doubles. The third class also calculates some things that are displayed with the display method in main.
    What I need to do is create a third class. This class needs to make a GUI to display the information. I currently have the programs display method display the information in a GUI but I need it to display each element one at a time with a NEXT and PREVIOUS button. The next button needs to go to the next array element and the previous button obviously needs to go back to the array element.
    Here is the code.
    //  Inventory Program
    //  Created June 20, 2007
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Inventory4 {
        public static void main(String[] args) {
            CD cd;
            Inventory inventory = new Inventory();
            cd = new CDWithGenre(16, "Disney Hits", 11, 13.01f, "Soundtrack");
            inventory.add(cd);
            cd = new CDWithGenre(12, "The Clash", 10, 19.99f, "Classic Rock");
            inventory.add(cd);
            cd = new CDWithGenre(45, "Dixie Chiks", 18, 10.87f, "Country");
            inventory.add(cd);
            cd = new CDWithGenre(32, "The Cure", 62, 25.76f, "Alternative");
            inventory.add(cd);
            cd = new CDWithGenre(18, "MS Office", 27, 99.27f, "None");
            inventory.add(cd);
            inventory.display();    
        } //End main method
    } //End Inventory4 class
         /* Defines data from main as CD data and formats it. Calculates value of a title multiplied by its stock.
          Creates compareTo method to be used by Arrays.sort when sorting in alphabetical order. */
    class CD implements Comparable{
        //Declares the variables as protected so only this class and subclasses can act on them
        protected int cdSku;        
        protected String cdName;               
        protected int cdCopies;
        protected double cdPrice;
        protected String genre;
        //Constructor
        CD(int cdSku, String cdName, int cdCopies, double cdPrice, String genre) {
            this.cdSku    = cdSku;
            this.cdName   = cdName;
            this.cdCopies = cdCopies;
            this.cdPrice  = cdPrice;
            this.genre = genre;
        // This method tells the sort method what is to be sorted     
        public int compareTo(Object o)
            return cdName.compareTo(((CD) o).getName());
        // Calculates the total value of the copies of a CD
        public double totalValue() {
            return cdCopies * cdPrice;
        // Tells the caller the title
        public String getName() {
            return cdName;       
        //Displays the information stored by the constructor
        public String toString() {
            return String.format("SKU=%2d   Name=%-20s   Stock=%3d   Price=$%6.2f   Value=$%,8.2f",
                                  cdSku, cdName, cdCopies, cdPrice, totalValue());
    } // end CD class    
         //Class used to add items to the inventory, display output for the inventory and sort the inventory
    class Inventory {
        private CD[] cds;
        private int nCount;
         // Creates array cds[] with 10 element spaces
        Inventory() {
            cds = new CD[10];
            nCount = 0;
         // Used by main to input a CD object into the array cds[]
        public void add(CD cd) {
            cds[nCount] = cd;
            ++nCount;
            sort();               
         //Displays the arrays contents element by element into a GUI pane
           public void display() {
            JTextArea textArea = new JTextArea();
            textArea.append("\nThere are " + nCount + " CD titles in the collection\n\n");
            for (int i = 0; i < nCount; i++)
                textArea.append(cds[i]+"\n");
            textArea.append("\nTotal value of the inventory is "+new java.text.DecimalFormat("$0.00").format(totalValue())+"\n\n");
            JFrame invFrame = new JFrame();
            invFrame.getContentPane().add(new JScrollPane(textArea));
            invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            invFrame.pack();
            invFrame.setLocationRelativeTo(null);
            invFrame.setVisible(true);
         // Steps through the array adding the totalValue for each CD to "total"
        public double totalValue() {
            double total = 0;
            double restock = 0;
            for (int i = 0; i < nCount; i++)
                total += cds.totalValue();                
    return total;
         //Method used to sort the array by the the name of the CD
    private void sort() {
         Arrays.sort(cds, 0, nCount);
    } // end Inventory class
    // Subclass of CD. Creates new output string to be used, adds a restocking fee calculation and genre catagory to be displayed.
    class CDWithGenre extends CD {
         String genre;
         CDWithGenre(int cdSku, String cdName, int cdCopies, double cdPrice, String genre) {
    super(cdSku, cdName, cdCopies, cdPrice, genre);
    this.cdName = cdName;
              this.cdCopies = cdCopies;
    this.cdPrice = cdPrice;
    this.genre = genre;
    // Calculates restocking fee based on previous data.
    public double restockFee() {
         double total = 0;
         double restock = 0;
         total = cdCopies * cdPrice;
         restock = total * .05;
    return restock;
    // New output method overrides superclass's output method with new data and format.
         public String toString() {
              return String.format("SKU: %2d     Genre: %-12s     Name: %-20s     \nPrice: $%6.2f Value: $%,8.2f Stock: %3d      Restocking Fee: $%6.2f\n",
    cdSku, genre , cdName, cdPrice, totalValue(), cdCopies, restockFee());
    }// Ends CDWithGenre class

    Hey Michael,
    I edited the code to add some more features but I am having some errors. Can you help again?
    Here is the code
    The additional buttons are for features I need to add. The commented part that says save need to save to a certain location.
    But the problem I am having is with the previous and next buttons. I need them to loop so when Next reaches the end of the array it needs to go to the first element again and keep on rolling thru. The previous needs to roll back from element 0 to the end again.
    This works when the program is not stopped on the last or first element. If I press the last button then press next, it errors. If I press the first button and press previous, it errors.
    I also need to add an icon
    Let me know what you think. Thanks a bunch
    class InventoryGUI
      Inventory inventory;
      int displayElement = 0;
      public InventoryGUI(Inventory inv)
        inventory = inv;
      public void buildGUI()
        final JTextArea textArea = new JTextArea(inventory.display(displayElement));
        final JButton prevBtn = new JButton("Previous"); 
        final JButton nextBtn = new JButton("Next");   
        final JButton lastBtn = new JButton("Last");
        final JButton firstBtn = new JButton("First");
        final JButton addBtn = new JButton("Add"); 
        final JButton modifyBtn = new JButton("Modify");   
        final JButton searchBtn = new JButton("Search");
        final JButton deleteBtn = new JButton("Delete");
        final JButton saveBtn = new JButton("Save");
        ImageIcon icon = new ImageIcon("images/icon.jpg");  
        JLabel label1 = new JLabel(icon);
        JPanel panel = new JPanel(new GridLayout(2,4));
        panel.add(firstBtn); panel.add(nextBtn); panel.add(prevBtn); panel.add(lastBtn);
        panel.add(addBtn); panel.add(modifyBtn); panel.add(searchBtn); panel.add(deleteBtn);
        //panel.add(saveBtn);
        JFrame invFrame = new JFrame();   
        invFrame.getContentPane().add(new JScrollPane(textArea),BorderLayout.CENTER);
        invFrame.getContentPane().add(panel,BorderLayout.SOUTH);
        invFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        invFrame.pack();
        invFrame.setSize(500,200);
        invFrame.setTitle("Inventory Manager");
        invFrame.setLocationRelativeTo(null);
        invFrame.setVisible(true);
        prevBtn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            nextBtn.setEnabled(true);
            displayElement--;
            textArea.setText(inventory.display(displayElement));
            if(displayElement <= 0) displayElement = 5;
        nextBtn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            prevBtn.setEnabled(true);
            displayElement++;
            textArea.setText(inventory.display(displayElement));
            if(displayElement >= inventory.nCount-1) displayElement = -1;
        firstBtn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            firstBtn.setEnabled(true);
            displayElement = 0;
            textArea.setText(inventory.display(displayElement));
        lastBtn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            lastBtn.setEnabled(true);
            displayElement = inventory.nCount-1;
            textArea.setText(inventory.display(displayElement));
    }

  • Submit button help (please)

    I have tried asking for help on this topic before, but didn't get any replies. So I try again.
    I have created a pdf form with a submit button that submits the form to a webservice url. I submit it as HTML.
    I receive the form data just fine in my webservice, but I don't know what to return. It seems that the webservice always returns something. I have tried returning a string but get the following:
    Is it possible to return a message saying that the form was receive ok or that an error occurred?
    Does anyone have an example?
    Thanks
    Birthe

    When you have a form, the form has to point to something so that the action of pushing a button on the page has the website do something.
    <form method="post" action="dothis">
    That pretty much needs to lead the form. In my case, "dothis" is a php page that does the actual heavy lifting. I do not think it is a good idea to put a "mailto" on a website because it invites spam. One might as well announce one's email address to all of the spambots in the world. I don't do that for myself and I won't do that for a client.
    So, in my case, "dothis" is a php call.
    Here, your question probably needs to migrate over to the php help area, but I'll offer a solution:
    <?php
    mail("[email protected]", $subject, $message, $from);
    ?>
    In php, the "mail" command will tell a server (that can send an email) to send an email to the address, along with the text that you have set up for the email subject, the text of the message and the text you gathered from the form for either the name or the email address of the person filling out your form.
    The "dothis" php call takes the information from the filled out form as a post and you use php to parse that posting for the information you need from your form. You can also have php check for form validity or for blanks where you don't want them and stop the script if the visitor did not fill out the form:
    if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput = "<h2>Your message was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    if(empty($visitor) || empty($visitormail) || empty($visitorphone) || empty($notes )) {
    echo "<h2>Use your Back button - fill in all fields, No message was sent.</h2>\n";
    die ("Use back! ! ");
    The first "if" statement checks for something approximating a real email address, the second checks for blank fields that are required.
    That should get you started.

  • Having compiler issues with Array, can anyone help please?

    Using your Invoice class created in lab02, write a client program that allows the user to input three Invoice objects into an array of Invoice objects. After you have inputted all of the invoices, print a heading and then output all of the array elements (Invoice objects) by calling the method from your Invoice class that displays all of the data members on a single line using uniform field widths to insure that all Invoice objects will line up in column format (created in Lab04). At the end of the loop, display the calculated total retail value of all products entered in the proper currency format.
    Example of possible program execution:
    Part Number : WIDGET
    Part Description : A fictitious product
    Quantity : 100
    Price          : 19.95
    (etc.)
    Example of possible output
    Part Number          Part Description          Quantity          Price     Amount
    WIDGET          A fictitious product     100          19.95     199.95
    Hammer               9 pounds          10          5.00     50.00
    (etc.)
    Total Retail Value:                                   249.95
    This is what I have so far at the bottom, can anyone tell me what I'm doin wrong please
    //Invoice Lab 6
    //Application to test class Invoice with arrays
    public class InvoiceTest
    public static void main( String args[] )
    Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    Invoice array [] = new Invoice [2];
    array [0] = new Invoice ("1234", "Hammer", 2, 14.95);
    array [1] = new Invoice ("5678", "PaintBrush", -5, -9.99);
    double total = 0.0;
    System.out.println("Part Number                    Description               Quantity          Price               Amount");
    System.out.println("----------------------------------------------------------------------------------");
    for (int i=0; <=2; i++)
    total+=array.getPaymentAmount();
         system.out.println("The Total retail value is: %.2f\n")
    // display invoice1
    System.out.println( "Original invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    // change invoice1's data
    invoice1.setPartNumber( "001234" );
    invoice1.setPartDescription( "Blue Hammer" );
    invoice1.setQuantity( 3 );
    invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    Invoice invoice2 = new Invoice( "5678", "PaintBrush", -5, -9.99 );
    // display invoice2
    System.out.println( "\nOriginal invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    // change invoice2's data
    invoice2.setQuantity( 3 );
    invoice2.setPricePerItem( 9.49 );
    // display invoice2 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    } // end main
    } // end class InvoiceTest

    Change this (check my comments):
    for (int i=0; <=2; i++) // what is <=2??  check the fixed version
    total+=array.getPaymentAmount(); //two things 1) this needs to be inside the for-loop 2) you need to tell the array which index to look at
    system.out.println("The Total retail value is: %.2f\n") //no need for \n because println does it automagically
    }to this:
    for(int i=0; i<array.length; i++) {
        total += array.getPaymentAmount();
    System.out.println("The total retail value is: " + total); //if you need another blank line like above be my guest
    Honestly, I didn't look past this part so fix this and post again if something is still broken.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • I opened my iPod Touch up to fix my home button. When i closed it back up it had a white screen. I tried pressing lock and home button for 10 seconds and it worked but while i'm using it it goes white with lines on the screen. Help please

    I opened my iPod Touch up to fix my home button. When i closed it back up it had a white screen. I tried pressing lock and home button for 10 seconds and it worked but while i'm using it it goes white with lines on the screen. Help please. This has been happening for a while and i've tried everything but it doesn't work.

    Try:
    fix for Home button
    iPhone Home Button Not Working or Unresponsive? Try This Fix
    - If you have iOS 5 and later you can turn on Assistive Touch it add the Home and other buttons to the iPods screen. Settings>General>Accessibility>Assistive Touch
    - If not under warranty Apple will exchange your iPod for a refurbished one for:
    Apple - Support - iPod - Repair pricing
    You can do it an an Apple store by:
    Apple Retail Store - Genius Bar
    or sent it in to Apple. See:
    Apple - Support - iPod - Service FAQ
    - There are third-party places like the following that will repair the Home button. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • TS3297 when I press the iTunes button on my ipod touch I get the message 'cannot connect to iTunes store' .  My wifi is working fine, I can connect to safari & you tube, no parental setting in place, and time and date are correct. Can anyone help please?

    When I press the iTunes button on my ipod touch I get the message 'cannot connect to iTunes store' .  My wifi is working fine, I can connect to safari & you tube, no parental setting in place, and time and date are correct. Can anyone help please? I have restored my ipod to factory settings and rest it.

    I also tried moving the date forward by a year and then moving it back to normal and it still doesn't work.  i can't find an automatic update of time zones on my itouch to turn this off.

  • I preordered One Direction's new album Midnight Memories, but did not purchase it. It is not in my downloads or purchases even though it says it's purchased. I can't even buy it because it says purchased and will not let me click the button. Please help!

    I preordered One Direction's new album Midnight Memories, but did not purchase it. It is not in my downloads or purchases even though it says it's purchased. I can't even buy it because it says purchased and will not let me click the button. Please help!

    Try:
    HT2519 Pre-ordered album, it says...: Apple Support Communities

  • My grandsons new Apple refurbed 35g ipad keeps locking up with a black screen amd nothing else. I have reset it many times pressing the home and off buttons together but uit keeps locking up. Help,please!

    My grandsons new Apple refurbed 35g ipad keeps locking up with a black screen amd nothing else. I have reset it many times pressing the home and off buttons together but it keeps locking up. Help,please!

    Thank you for trying to help. I followed your instructions, it took 6 hours to download, and then said it could not solve the problem (something to do with error 9?). It will have to go back to Apple - its only 3 days since it came out of the package and its very disappointing for him. Looks like I have to hang around in the Apple store in Plymouth all tomorrow until they can fix it, or will change it. Thanks for your help.

  • Can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    I have same problem.
    However, I am unable to turn on Assistive Touch.
    At one time I was able to activate it, but it went away and now I cant reactivate.
    What is the solution?

  • My back and forward buttons do not work also the refreash button does not work, I have reloaded the latest version of fire fox and that did not help. HELP please.

    My back and forward buttons do not work also the refresh button does not work, I have reloaded the latest version of fire fox and that did not help. All of navigation tool bar worked until I updated Fire Fox, now if I click on a link in yahoo, for instance, I can not get back to my yahoo home page without reloading Fire Fox. HELP please.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.com/kb/Bookmarks+not+saved#w_places-database-file

  • TS1702 Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

    Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.

  • Just upgraded my iPad to IOS5 and when the download was completed, a window said that there was an error and it could not restore.  Now I have a black screen with the Apple logo and the circle lines.  None of the buttons respond. Help, please!!

    Just upgraded my iPad to IOS5 and when the download was completed, a window said that there was an error and it could not restore.  Now I have a black screen with the Apple logo and the circle lines.  None of the buttons respond. Help, please!!

    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. Maybe this will let the iPad reboot and then you may need to restore again but see if this helps to start the iPad first.

  • My itouch screen is frozen, wont slide to unlock. have done what adviced with buttons...can anyone help please?

    my itouch scrren is frozen, it wont slide to unlock..i have done all that was adviced with the buttons but that didnt work..can anyone help please?

    Force iPad into Recovery Mode
    1. Turn off iPad
    2. Connect USB cable to computer; leave the other end alone
    3. Press and hold the Home button down and connect the docking end of cable to iPad
    4. Continue holding the Home button until you see the "Connect To iTune" screen
    5. Release the Home button
    6. Open iTune
    7. You should see "iTunes has detected an iPad in recovery mode"
    8. Use iTune to restore iPad
    Note: You need to be patient and repeat the above many times.

Maybe you are looking for

  • JAAS-Seciruty without j_security_check

    Hi, I would like to change my JAAS-based J2EE Application, so that the authentication is no more made using the standard servlet j_security_check, because I would like to get control of the login-context, for instance for logout. Is this possible ? H

  • ITunes Gives me a BSOD

    My iTunes randomly will give me a Blue Screen of Death or it will tell me is has encountered a problem and has to quit. I have reinstaled both the latest iTunes and quicktime and nothing has worked so far. Granted it is not every time i open iTunes j

  • How do I get Creative Cloud.app to stop asking me for my old email address ?

    How do I get Creative Cloud.app to stop asking me for my old email address that I do not have access to? I have reinstalled it several times and it stills asks for it! I spent several hours on Chat and my help specialist logged off before I had an an

  • How to get a replacement path variable working in same query

    Hi All I have a query in which the user enters a value for the 0fiscper variable. Our users want to display for the last 12 months the previous year same period sales. I do this by putting a value range offset restriction on 0fiscper varianle to -12

  • KSII doesn't recalculate activity rates

    Hi, I've taken the following steps in order to configure cost splitting through activity types: Configured transactions OKEQ and OKET Created an activity type in KL01 Created a splitting structure in OKES, defining cost splitting to a certain group o