Need Help Fast Please

Why does this code not do what I want to happen?
I have a 7 non functional buttons above the buttons for the days in the month and I would like to be able to layout the buttons starting on the day that the month begins and ending where it ends.
Like in the microsoft windows calander.
Any ideas as to how I'd do this?
I need help fast. Please.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.*;
public class MyDairy extends JFrame
     //Initilises Global Variables
     myHandler H = new myHandler();
     monthHandler J = new monthHandler();
     openHandler O = new openHandler();
     String monthName;
     JComboBox months;
     static String[] daysOfWeek = {"Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"};
     static int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 
     JFileChooser box;
     public MyDairy()
          //Initilises the JComponents
          JMenuBar menuBar;
           JMenu menu;
          JMenuItem menuOpen;
          JMenuItem menuSave;
          JMenuItem menuExit;
          JButton dayName[] = new JButton[7];
          JButton day[] = new JButton[36];
          JPanel b;
          JPanel a;
          Calendar today = Calendar.getInstance();
          Calendar startOfMonth = Calendar.getInstance();
          startOfMonth.set(Calendar.DAY_OF_MONTH,1);
          startOfMonth.set(Calendar.DAY_OF_WEEK,7);
          System.out.print(startOfMonth);
          //Sets up the Layout
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          Container c = getContentPane();   
          c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));
          a = new JPanel();   
          a.setLayout(new GridLayout(0, 7));
          b = new JPanel();   
          b.setLayout(new GridLayout(5, 7));
          //Sets up and adds the menu bar   
          menuBar = new JMenuBar();   
          setJMenuBar(menuBar);  
          //Adds the File menu
          menu = new JMenu("File");   
          menuBar.add(menu);
          //Adds the menu items      
          menuOpen = new JMenuItem("Open");     
          menu.add(menuOpen);
          menuSave = new JMenuItem("Save");     
          menu.add(menuSave);
          menuExit = new JMenuItem("Exit");     
          menu.add(menuExit);
          //Produses the ComboBox
          String[] name={"January", "Feburary", "March", "April", "May", "June", "July", "Augest", "September", "October", "November", "December"};
          months = new JComboBox(name);
          int m = today.get(Calendar.MONTH);
          int d2 = today.get(Calendar.DAY_OF_WEEK);
          System.out.print(d2);
          months.setSelectedIndex(m);
          months.addActionListener(J);
          c.add(months);
          c.add(Box.createVerticalStrut(10));
          switch (months.getSelectedIndex())         
                   case 0: for (int i=1; i<36; i++)                          {                   
                     if(i<4)                
                        day[i] = new JButton();                  
                        day.setEnabled(false);               }               
int k = 1;                
day[i] = new JButton(" "+k);                b.add(day[i]);                
day[i].addActionListener(H);               k++;               
}break;          
//other case statement up to 11 are simaliar          }                     
c.add(a);
          //Produces an Array of Buttons
          for (int i=1; i<36; i++)
               day[i] = new JButton(" "+i);
               b.add(day[i]);      
               day[i].addActionListener(H);               
          c.add(b);
          updateNameField();
          setSize(400,400);
          show();
     }//constructor
     private void updateNameField()
          monthName = (String) months.getSelectedItem();
     class myHandler implements ActionListener
          public void actionPerformed(ActionEvent e)
               new Text_Area(monthName);
     class openHandler implements ActionListener
          public void actionPerformed(ActionEvent e)
               File f1 = New File ("2003.dat");
               simpleSerializer S = new simpleSerializer(f1);
               MyDairy = S.readObjectFromFile();
     class monthHandler implements ActionListener
          public void actionPerformed(ActionEvent e)
               updateNameField();
     public static void main(String[] args)
          new MyDairy();

Container c = getContentPane();
c.setLayout(new BoxLayout(c, BoxLayout.Y_AXIS));don't code like above try something like...
Box box=Box.createVerticalBox();
c.add(box);
----so on
Hope this will help...

Similar Messages

  • My screen is completely white, i've tried holding lock and home buttons as seen on you tube something called 'white screen of death' its goes black (think it switches off) then back to the white screen need help fast please!

    my screen is completely white, i've tried holding lock and home buttons as seen on you tube something called 'white screen of death' its goes black (think it switches off) then back to the white screen need help fast please!

    If you have not done a factory reset on the device, I recommend doing a complete  factory reset.  
    Factory Reset  - Warning this will reset device back to original factory settings.
    This method will not erase any MDN/MIN information
    Turn off the phone 
    Press Power + Volume Up/Down at the same time and hold until display will show a triage android screen 
    Display will show: 
    Reboot system Now 
    Apply sdcard:update.zip 
    Wipe Data/Factory Reset 
    Wipe Cache Partition
    Use VOL Down key to scroll down to "Wipe Data/Factory Reset", press home icon to select option and wipe device. 
    Display shows "All user data will be wiped out", press VOLUME Up to continue or VOLUME Down to exit. 
    Press Volume Up 
    Press Home to select "Reset System Now" - device will reboot
    If the problem persist I recommend having a store technician take a look at the device.
    Copy and paste the link below into your browser's address bar for the store locator.  
    http://www.verizonwireless.com/b2c/storelocator/index.jsp

  • P45 Platinum NEED HELP FAST PLEASE!

    As you may have read previously, I was going to and I got a P45 Zilent board along with other parts. Now I have a few problems. Firstly here are the system specs:
    MSI P45 Platinum (Zilent) BIOS v1.0
    Intel Core 2 Duo E8300
    A-DATA Vitesta 1066+ 2x1GB
    MSI R4850
    1XWD RAPTOR 74GB
    1XWD CAVIAR 200GB
    1XWD CAVIAR 500GB
    1XSAMSUNG SATA DVDRW 22x
    PSU: Cooler Master Real Power M520
    HANNS-G HI221DP (22" Widescreen connected with DVI-D Single Link Cable)
    So, when I installed everything, and turned on the PC the DOS looking environment that shows up before the OS is loaded is filled with exclamation marks on the background, and in the BIOS has dots on the background. I thought at first OMG my VGA is faulty, but then in Windows it shows perfectly good image quality and no problems what so ever...
    Second problem: My PC won't reboot. When it goes to reboot, it goes through the shutdown sequence properly, but after that when it needs to restart it just hangs and the 4 indicator lights are all red. Now when it starts normally there is no hang, all the lights are green and system is working fine. But every time it restarts it hangs there and nothing happens... :S
    And third on CPU Z my the PC multiplier varies and also the bus speed is too low... here is a screenshot:
    Now, even though the multiplier changes when PC under load, and I read it is some kind of power saving option, the BUS remains that low :S
    Please help me fast, please.

    Quote
    Now the multiplier problem remains, but I read somewhere it is a power saving feature, but still I want to disable it and make my multiplier at 8.5 all the time and my CPU speed at 2.83GHz (stock speed for the E8300). How can I do that, without messing up the settings in the BIOS that fixed the problems above?
    There is no real need to disable that function.  After all, it is a feature of your processor, you paid for it and the Multiplier should switch back to default as soon as you CPU gets something to do.  It will only drop to x6 when the system is IDLE to save power and keep the temperatures low.  There should not be any performance sacrifices. Keep in mind that the Core Voltage is reduced as well.  This is all intended to for the benefit of your Processor and therefore for you, after all.
    However, if you really think that you want to disable these functions, you may want a little info on what functions are actually involved:
    1) EIST = Enhanced Intel SpeedStep Technology -> The option is located in the Cell Menu.  You can actually disable EIST on the OS level (and keep in enabled in BIOS).  All you need to do is to turn off the Windows Power Saving Features and set everything to max. Performance.  This disables SpeedStep/EIST, even when the support is still enabled in BIOS. 
    2) C1E Support (C1E = Enhanced Halt State) -> This feature can only be disabled in BIOS.  Even if EIST is disabled (OS and/or BIOS), the C1E Feature will still be doing its job.  To disable it, look in the CPU Features Section of the BIOS.  You should find an option there.
    In any case, my suggestion would be to keep both functions enabled.  These features are actually rather good.
    Quote
    Also how do I set my memory to run at the preferred settings prescribed by the manufacturer, which are:
    CL: 5-5-5-15 2T
    2.2-2.3V
    1066MHz
    The standard DDR2 supply voltage is 1.8V +/-0.1V.  The fact that your memory modules need to be overvolted to have a chance to run at DDR2-1066 MHz shows that they are not "real" DDR2-1066 memory modules but actually just DDR2-800 sticks with a manufacturer's permission to overclock them.  Also, keep in mind that the P45 Chipset does not natively support DDR2-1066 memory modules, but DDR2-667 & DDR2-800 only.
    This said, you actually need to overclock both the memory controller and the modules, which is not necessarely stable.
    To increase the memory voltage, you need to manually adjust the FSB/DRAM Ratio in BIOS to 1:1.6 and manually increase the DRAM Voltage using the +/- keys of your numpad.  Spread Spectrum should be disabled at all times.

  • I need help fast please an't render my full audio equalizer from adobe after effect

    I need help really fast i can't render my full audio equalizer from adobe after effect

    Without knowing any details about your comp or render settings, this is going nowhere. This could be anything from Quicktime acting up to having set the work area.... We don't even know what version of AE you use on what OS.
    Mylenium

  • I need help fast please!

    I downloaded a program and when I open it something pops up. Why does this happen and how can i fix this problem? Here it is:
    [IMG]http://i51.tinypic.com/efhspc.jpg[/IMG]

    Are you referring to...?
    _Conquer Online_ - main:
    http://co.91.com/index/
    CO Mac Beta Client - Conquer Online: Beta Test Version
    http://co.91.com/content/2011-04-07/20110407043308516.shtml
    • *Conquer - client for Mac*: +Version 1001, a 705MB D/L:+
    ftp://64.151.84.188/enzf/MACqonquerv1001.pkg.zip
    There are other download files, some end in .exc for windows.
    all Downloads - Client - Conquer Online - Free Kung Fu:
    http://co.91.com/downloads/client.shtml
    The main page appears to have a few help items, no support;
    unless you go into Contact and see if they reply to email.
    Another free Conquer game online, is *Conquer Club*:
    http://www.conquerclub.com/
    You may have to see if you downloaded the correct version for
    your Mac OS X system, and ask the company behind it, if they
    support Leopard 10.5.8 and JRE for Mac (java version.)
    The incorrect file type would not open nor could it run. Without
    replicating the issue, I'm not able to resolve the problem here.
    A maker's support page and Mac version user forum may exist.
    Sorry to not be of further help; if someone recognizes the game
    from the links I found (if that is the game you refer to) perhaps
    another Discussions member could answer your question.
    If the 'autoupdater' pertains to the +automatic patches+ the maker
    says would be applied when the application/game is first-run,
    you may have to see about getting them separately, if they apply.
    • The developer may have *undisclosed bugs in their Beta* version
    for Mac, so you need to try and contact them. As Mac users here,
    replies you may get would pertain to the Mac OS X & the Mac.
    Good luck & happy computing!
    +{ edited }+

  • Forgotten password for iPhone 4s and done a remote lock via iCloud and now cannot get into phone! need help fast please!

    Look i really need to know how to get back in my phone as it is for buissness and very desparate please answer asap

    The manual expalins this.
    Restore the iphone.

  • Need help fast please KM2M Combo-L(MS-673

    What video cards can this handle? I want to get a new GF4 ti card but what will it runm I don't want to blow anything, and is there a special somthing I have to do or is it just put and in and works? KM2M Combo-L(MS-673 .. cheers, wanna order today so any help would be great.

    Hi..
    About the fact that 8x AGP cards in 4x agp slots... Not a problem.. U c, 8x agp is backwords compatible to 4x agp but 8x is not compatible with 2x agp.. So no prob for u there
    About the part where u wanna just plug it in and working.. I am not sure about it.. The G4Ti cards eat up so much power that u might (possibly) have to replace the power supply.. U should have a look at these two articles written by Bas before going ahed with the vga card.. As far as compatibillity goes.. No prob
    http://www.msi.com.tw/program/service/forum/index.php?threadid=1515&boardid=16&styleid=1&sid=5fae4c1fda1dd9be2141b5e39030ab06
    http://www.msi.com.tw/program/service/forum/index.php?threadid=1135&boardid=16&styleid=1&sid=5fae4c1fda1dd9be2141b5e39030ab06
    Hope this helps
    Regards
    Rasika

  • Major issues after Lion update - need help fast (please!)

    Following instructions learned on this discussion board I attempted to do a clean install of FCP X & Lion on a wiped drive.  I first cloned my main (Mac) drive onto another internal drive, then wiped the original Mac drive clean.  Next, I installed Lion on that drive and then was stymied at the Migration Assistant as it only gave the option to transfer ALL apps, and not specify which of those I would like to transfer.  I was under the impression that FCP 7 and FCP X should not reside on the same drive.  Therefore I manually copied all but the "FCP Studio" folder back onto the main drive and then used the Migration assistant to transfer all the rest of the files.  Trouble is that I now somehow have 2 user accounts, and they are both acting very differently:
    - In the new user account FCP X opens with almost all files intact yet there is no audio and since Aperture doesn't appear on this account there are no stills in my project(s).
    - In the old (orginal) user account FCP X opens with nothing more than my project names visible, yet Aperture (and all other apps) ARE visible on this account
    My questions are as follows:
    1. Is there a way to combine these accounts?
    2. How do I recover audio files (these are primarily V/O tracks and Smart Sound music tracks)
    3. Is there some other workaround or re-do that I should do?
    Thanks in advance!

    You might  want to post the user account issue in the Lion discussion group. Sounds like you created a user account when you installed Lion and then moved over a user account, which is why you have two accounts.
    I believe you can work around this, but it would be best to get advice from a Lion OS X expert. Hence the other discussion group.

  • My daughter has spitefully changed my password and has refused to tell me. I have so much medical information that I can not lose. Is there anyway to get around this problem. Please I need Help fast.

    My daughter has spitefully changed my password and has refused to tell me. I have so much medical information that I can not lose. Is there anyway to get around this problem. Please I need Help fast.

    Connect the iPod to your syncing computer and restore it via iTunes.  However, if iTunes asks for the unknown passcode you need to place the iPod in recovery mode and then restore the iPod from backup.  For recovey mode see:
    iPhone and iPod touch: Unable to update or restore
    "If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software."
    Above is from:
    http://support.apple.com/kb/ht1212

  • I am trying to export a video as an flv but the list of possible formats is much shorter than it used to be. I cannot find any way to make an FLV using the newest version of Premiere Pro. Need help fast! I am on a Mac

    I am trying to export a video as an flv but the list of possible formats is much shorter than it used to be. I cannot find any way to make an FLV using the newest version of Premiere Pro. Need help fast! I am on a Mac

    Support for exporting to FLV and F4V has been removed. To learn more, please consult this blog post: removal of FLV and F4V export features from Adobe Media Encoder, After Effects, and Premiere Pro | After Effects regio…

  • Premiere Pro CC updated  - crashes almost immediately on my mac OS X Yosemite 10.10.3. Crashes at startup, crashes with media import, crashes when creating a sequence. NEED HELP FAST I have tried many troubleshooting solutions I found online nothing has

    Premiere Pro CC updated  - crashes almost immediately on my mac OS X Yosemite 10.10.3. Crashes at startup, crashes with media import, crashes when creating a sequence. NEED HELP FAST> I have tried many troubleshooting solutions I found online nothing has worked.

    Hi,
    Sorry to hear about the experience. Please provide your computer configuration details.
    Memory, Processor, Graphics card, Exact version of Premiere Pro, Error message that you are get. If you can post screenshots of the error report that would be helpful.
    Thanks,
    Rameez

  • Sound trouble need help urgent please

    Could somebody tell me how i can fix my problem.
    problem: when my curve 8520 is in silence profile en i start typing in a phnoe number i hear nothing,
    but when my phone is in normal profile i hear i beep with every number of the phone number i enter.
    so i want to know how i can stop my bb from making this noise

    My friend it is a fillable form, can i email you the pdf that iam trying to fill out? then would you be able to tell me how to do it please mate?
    I have attached the form, i need to fill in those boxes so that everything is accuratly height + spacing is correct, and to do it fast, thats all im after.
    Date: Sun, 27 Jun 2010 18:31:58 -0600
    From: [email protected]
    To: [email protected]
    Subject: Need Help Urgent Please
    If is a fillable form, just tab to the next field. What we do not understand from you is IF it is a fillable form or not. If it is not, then the 3 options I gave can be used. Placing text is always a problem. You might find it useful to turn on the grid to help in placing your typewriter fields. However, if it is fillable you do not have to create any fields to type in, you just leave the tool as the hand tool and select the predefined fields with the cursor or the tab key and type accordingly. If the field is a checkbox, then you just use the space key to activate it.
    So, are we talking about a fillable form or something that has the appearance of a form, but not fields to fill in. This is what Bernd has been try to find out and you keep suggesting it is fillable as we read what you have said.
    >

  • I NEED HELP FAST!!! how can i activate wi-fi if i want to use that for facebook apps instead of wasting my data?

    i want the 200 mb plan for my iphone and wanted to know if instead of using safari i can use apps such as facebook or tumblr without using up my data. i got the asnwer that i can avoid that by using wi-fi, but how does that whole thing work?
    sorry i am a bit new at this, and i need help fast!
    THANK YOU!

    hookedonlerman wrote:
    but will that replace the use of using up data? (wifi & 3G)
    It sounds as if you don't really understand what "using data" means. Data is not something different from WiFi and 3G, it's something sent over WiFi and 3G. Think of data as water and WiFi and 3G as types of pipes. Some apps need to send and receive data to work. That data can be sent or received in different ways. It can be sent over WiFi or 3G. Both official iPhone carriers in the U.S. have metered data plans. It's sounds as if you're talking about AT&T's 200 mb data plan. WiFi is not provided by your cellular carrier. You can have WiFi from your Internet Service Provider at home or you can access free WiFi at places like McDonalds or Starbucks or paid WiFi at places like airports.
    If you have WiFi turned on on your phone and WiFi is available, the phone will default to WiFi. WiFi is faster than 3G and generally not metered, and is sometimes even free. If you are out of range of WiFi, you would be using 3G to send and receive your data. With a metered plan, you need to keep an eye on how much you are using because if you go over your allowance, you will be charged additional fees.

  • My little brother messed up with my iPod touch 4th Gen by entering the wrong password , now all data is beeing erased what should I do.The iPod is just showing the Apple Logo and some buffering icon below it.Need help fast!I'm really worried!

    I really need help this has happend 5 hours ago and the ipod os still showing the apple logo and the buffering icon below it!
    It re booted several times till now.
    Need help fast!

    - I suspect that he went to Settings>General>Reset>Erase all content and settings.  For 1G or 2G iPod that can take hours and it will likely stall out if not connected to a charging source.
    Try the following:
    - A reset.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - The connect to computer and try to restore via iTunes.
    - Id something is still showing onthe screen, disconnect from computer/charging source and let the battery fully drain. After charging for an hour, Try the reset and restore.
    - If you can turn the iPod off, se if placing the iPod in recovery mode and then restore. For recovey mode:
    iPhone and iPod touch: Unable to update or restore

  • Need help fast with a buying decision - Leadtek 6800 GT

    Hi there, I have the opportunity to swap my Club 3D 6800 GT for a Leadtek 6800 GT. The reasons I would do this would be the cooling and the games bundle.
    I just wanted to know if anyone knows how the cooling is on this particular card and if it would be better than the reference design?
    My other concern is that it has a huge copper heatsink on the back of the card, this would sit directly under the CPU HSF. There really would only be a few millimeters between them and due to the position of the socket on this board, the heat sink fins go up vertically. Would the heat from the card's copper heat sink rise up into the CPU HSF grooves and raise the temperature of the CPU?
    Thanks for any help  
    I kind of need help fast as someone said they were gonna buy my other card of ebay today, there's still time to stop them if this is gonna be a bad idea

    i would definately take the leadtek one over the club3d card, the cards themselves are all based on refrence designs just different cooling solutions and bundles
    and the cooler on the leadtek is a lot better, and it isnt more noisy then the club3d one at all
    it has better cooling, and they seem to be the ones which are the most available, and they overclock very well due to the better cooling

Maybe you are looking for

  • Can only connect one laptop via AEBS wifi

    i was able to use my internet service with my Apple Airport Express Base Station (AEBS) for months without any problem and it was capable of simultaneous internet sharing (via wifi) among 3 laptops without the need to enter / directed to the internet

  • Partial Goods Receipt for Inbound Delivery

    Hello Frends, We have a requirement to generate partial goods receipt against Inbound delivery created in Intercompany scenarios, however when we analzed there two alternative ways possible - 1.  Goods Receipt in Inbound Delivery - Transaction VL32N

  • Interactive report on SELECT * FROM X

    Hi, Is there anyway to create an interactive report using SELECT * FROM my_table; where you can add a new column to "my_table" and for the interactive report to pick up the new column without having to go into the report region and hit apply changes?

  • Getting subscription fees from user. Implementing this?

    I'm wondering what options are there and what would be the best option to handle receiving subscription payments from users of a business J2ME app? I would like to have them charged to their phone bill. If the user has been using the app for 6 months

  • Open folder, date modified date changing

    I finally updated to OSX Lion and now when i access our Windows server 2012 server, as soon as i click to open a folder the date modified date changes to today. I am not opening any files just viewing the contents of the folder. This is causing a pro