ActionListener Difficulty

Hi !!
I'm a student working on an assignment and I'm kind of stuck here, I hope you guys can help!
I'm trying to invoke one class from another through the use of ActionListener Interface.
I've been using a small example to try make it work but haven't been able to:
This is the class that implements the actionlistener for a button:
import javax.swing.*;
import java.awt.event.*;
public class TrialGui implements ActionListener
JButton button;
//private void run ()
// JTextField txt = new JTextField(10);
//frame.getContentPane().add(txt);
//SW nuevaSW = new SW("It works");
public static void main (String[] args)
TrialGui gui = new TrialGui();
gui.go();
public void go()
JFrame frame = new JFrame();
button = new JButton("Click me");
button.addActionListener(this);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
public void actionPerformed (ActionEvent ae)
//button.run();
button.setSize(200,300);
Now, I would like the button rather than to be resized to launch another class when pressed (this other class has been created in a different .java file) . As you can see I've tried creating the run method for launching the other class but it didn't work.
This is the other class I would like to be fired when pressing the button:
import javax.swing.*; // Contains the JFrame, JButton, etc.
import java.awt.*; //Contains the Border Layout
import java.awt.event.*;// package containing ActionListener and ActionEvent
//import java.util.Hashtable; Was being Used with GraphPaperLayout: Couldn't manage to make it work!
public class SW //implements ActionListener
JButton button1;
JButton button2;
JButton button3;
JButton button4;
JButton button5;
JButton button6;
JButton button7;
JButton button8;
// Declare main method
public static void main (String[] args)
/** What can I use to substitute the main. I think that in the programme
* one should not have more than one main method. But I'm not sure what
* to call this method or how it will influence the rest of the code.
// Creates an instance of SecondWindow
SW gui = new SW();
gui.go();
public void go()
// Generate frame and panels + look and feel
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame("Campaign Details");
JPanel panel1 = new JPanel(); // To occupy northern region of frame layout
JPanel panel2 = new JPanel(); // To occupy central region of frame layout
JPanel panel3 = new JPanel(); // To occupy southern region of frame layout
GridBagLayout gbl = new GridBagLayout();//Generates layout for panel2
// Generate the necessary buttons
button1 = new JButton("GO");
button2 = new JButton("Edit"); // times 3
/** Can I add the same button (button2) three times to the same panel and yet assign
* each different functions? they would all be edit buttons but
* they will be editing different parametersof the campaign
button3 = new JButton("Add Keywords");
button4 = new JButton("New Campaign");
button5 = new JButton("Log Out");
button6 = new JButton("Refresh");
button7 = new JButton("Edit");
button8 = new JButton("Edit");
// Generate the necessary txtAreas
JTextArea txtArea1 = new JTextArea(1,4);
JTextArea txtArea2 = new JTextArea(1,4);
JTextArea txtArea3 = new JTextArea(1,4);
JTextArea txtArea4 = new JTextArea(1,4);
JTextArea txtArea5 = new JTextArea(1,4);
JTextArea txtArea6 = new JTextArea(1,4);
JTextArea txtArea7 = new JTextArea(1,4);
JTextArea txtArea8 = new JTextArea(1,4);
JTextArea txtArea9 = new JTextArea(1,4);
/** Need to ask whether the data that will be
* downloaded from the google server can be displayed on a
* JTextField or do I need some other thing for displaying it?
* I found the JTextArea but I don't know how appropriate this is.
// Generate the necessary labels
JLabel label1 = new JLabel("Select Campaign:");
JLabel label2 = new JLabel("Impressions:");
JLabel label3 = new JLabel("Clicks:");
JLabel label4 = new JLabel("Budget:");
JLabel label5 = new JLabel("Monthly");
JLabel label6 = new JLabel("Daily");
JLabel label7 = new JLabel("Keywords:");
JLabel label8 = new JLabel("Popularity");
JLabel label9 = new JLabel("Avg.\nCPC");// how do I make it two lines?? /que?
JLabel label10 = new JLabel("Cost");
//Generate the necessary Drop Down Menus
String[] items = {"ApoyoVenezuela", "Other Campaign", "..."};
JComboBox editableCB1 = new JComboBox(items);
//editableCB1.setEditable(true);
String[] items2 = {"Venezuela", "hugo chavez", "ApoyoVenezuela", "..."};
JComboBox editableCB2 = new JComboBox(items2);
//editableCB2.setEditable(true);
// What class can I use to generate these menues???
// Defines format of fonts to be used
Font bigFont = new Font("Courrier New", Font.PLAIN, 12);
Font smallFont = new Font("Courrier New", Font.PLAIN, 9);
Font boldBigFont = new Font("Courrier New", Font.BOLD, 15);
Font boldSmallFont = new Font("Courrier New", Font.BOLD, 10);
// Assign fonts to differet components
button1.setFont(smallFont);
button2.setFont(smallFont);
button3.setFont(bigFont);
button4.setFont(bigFont);
button5.setFont(bigFont);
button6.setFont(bigFont);
button7.setFont(smallFont);
button8.setFont(smallFont);
label1.setFont(bigFont);
label2.setFont(boldBigFont);
label3.setFont(boldBigFont);
label4.setFont(boldBigFont);
label5.setFont(boldSmallFont);
label6.setFont(boldSmallFont);
label7.setFont(boldBigFont);
label8.setFont(boldSmallFont);
label9.setFont(boldSmallFont);
label10.setFont(boldSmallFont);
//Assign ActionListener Fuctionality to buttons
//button1.addActionListener(this);
//button2.addActionListener(this);
//button3.addActionListener(this);
//button4.addActionListener(this);
//button5.addActionListener(this);
//button6.addActionListener(this);
//button7.addActionListener(this);
//button8.addActionListener(this);
// Format frame and panels
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//atmtclly ends Prgmm on clsing the frame
frame.getContentPane().add(BorderLayout.NORTH, panel1);//fit panels inside the frame
frame.getContentPane().add(BorderLayout.CENTER, panel2);
frame.getContentPane().add(BorderLayout.SOUTH, panel3);
panel1.setBackground(Color.yellow); // set panels background colour
panel2.setBackground(Color.blue);
panel3.setBackground(Color.red);
panel2.setLayout(gbl); // Assign gbl layout created above
//Set constraints for gbc
GridBagConstraints gbc = new GridBagConstraints();
//Components spanning three columnsand aligned to the left (west)
gbc.gridwidth = 3;
gbc.anchor = GridBagConstraints.WEST;
gbc.gridx = 0;
gbc.gridy = 1;
gbl.setConstraints(label4, gbc);
panel2.add(label4);
gbc.gridx = 0;
gbc.gridy = 2;
gbl.setConstraints(label2, gbc);
panel2.add(label2);
gbc.gridx = 0;
gbc.gridy = 3;
gbl.setConstraints(label3, gbc);
panel2.add(label3);
gbc.gridx = 0;
gbc.gridy = 4;
gbl.setConstraints(label7, gbc);
panel2.add(label7);
gbc.gridx = 0;
gbc.gridy = 6;
gbl.setConstraints(button3, gbc);
panel2.add(button3);
gbc.gridx = 0;
gbc.gridy = 5;
gbl.setConstraints(editableCB2, gbc);
panel2.add(editableCB2);
//Sets back 2 column spanning and aligns back to the centre
gbc.anchor = GridBagConstraints.CENTER;
gbc.gridwidth = 1;
gbc.gridx = 3;
gbc.gridy = 0;
gbl.setConstraints(label5, gbc);
panel2.add(label5);
gbc.gridx = 4;
gbc.gridy = 0;
gbl.setConstraints(label6, gbc);
panel2.add(label6);
gbc.gridx = 3;
gbc.gridy = 4;
gbl.setConstraints(label8, gbc);
panel2.add(label8);
gbc.gridx = 4;
gbc.gridy = 4;
gbl.setConstraints(label9, gbc);
panel2.add(label9);
gbc.gridx = 5;
gbc.gridy = 4;
gbl.setConstraints(label10, gbc);
panel2.add(label10);
gbc.gridx = 5;
gbc.gridy = 1;
gbl.setConstraints(button2, gbc);
panel2.add(button2);
gbc.gridx = 4;
gbc.gridy = 6;
gbl.setConstraints(button7, gbc);
panel2.add(button7);
gbc.gridx = 5;
gbc.gridy = 6;
gbl.setConstraints(button8, gbc);
panel2.add(button8);
gbc.gridx = 3;
gbc.gridy = 1;
gbl.setConstraints(txtArea1, gbc);
panel2.add(txtArea1);
gbc.gridx = 3;
gbc.gridy = 2;
gbl.setConstraints(txtArea3, gbc);
panel2.add(txtArea3);
gbc.gridx = 3;
gbc.gridy = 3;
gbl.setConstraints(txtArea5, gbc);
panel2.add(txtArea5);
gbc.gridx = 3;
gbc.gridy = 5;
gbl.setConstraints(txtArea7, gbc);
panel2.add(txtArea7);
gbc.gridx = 4;
gbc.gridy = 1;
gbl.setConstraints(txtArea2, gbc);
panel2.add(txtArea2);
gbc.gridx = 4;
gbc.gridy = 2;
gbl.setConstraints(txtArea4, gbc);
panel2.add(txtArea4);
gbc.gridx = 4;
gbc.gridy = 3;
gbl.setConstraints(txtArea6, gbc);
panel2.add(txtArea6);
gbc.gridx = 4;
gbc.gridy = 5;
gbl.setConstraints(txtArea8, gbc);
panel2.add(txtArea8);
gbc.gridx = 5;
gbc.gridy = 5;
gbl.setConstraints(txtArea9, gbc);
panel2.add(txtArea9);
panel1.add(label1);
panel1.add(editableCB1);
panel1.add(button1);
panel3.add(button6);
panel3.add(button4);
panel3.add(button5);
// Set frame dimensions and make it visible
frame.setSize(320,300);
frame.setVisible(true);
//Set actions for the ActionListener enabled buttons
//public void actionPerformed (ActionEvent ae)
//button1.
Thank you very much for your help, I really appreciate it.
Cheers

Thanx for yout pronpt reply!!
I've added
SW sw = new SW();
to the actionPerformed method and it seems to actually invoke the SW class. I've also added the following method to the SW class
public SW()
//build the GUI here, or call a method that builds it from here
SW sw2 = new SW();
but when I run it I get some error which I can't understand. I'm using the cmd to compile and execute and can't read the first lines of teh error. The only line of the error I can see is:
at SW.<init>(SW.java:22)
which keeps on repeating untill I stop the programme from running
To be sincere I'm confused with all this code and I'm no quite sure what method to use to make it work.
Please help!! :-)
Cheers

Similar Messages

  • Need help creating actionListener for an array of text fields

    I am working on a school project, so I am very new to Java. I have a program which is basically a unit converter. Each unit type has its own tab. I was able to dynamically create text fields in each tab and now I need to add actionListener to each of those text fields. Probelm is, the text fields are not really unique. I guess they're only unique within their tab. So now I am having difficulty referring to my text fields. If you look at my actionListener in the code below, I am trying to refer to it as unitTFs[0].getText() and that's not working. Please help. Thanks in advance.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class UnitConverter extends JPanel
    public UnitConverter()
    String[] lengthUnits = {"cm","m","inch","feet","yard","mile"};
    String[] areaUnits = {"m2","a","feet2","yd2","Acre","ha"};
    String[] massUnits = {"g","kg","ton","ounce","pound"};
    String[] volumeUnits = {"liter","m3","inch3","feet3","Gallon","Barrel"};
    String[] tempUnits = {"C","F"};
    ImageIcon lengthICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon areaICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon massICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon volumeICN = new ImageIcon("java-swing-tutorial.JPG");
    ImageIcon tempICN = new ImageIcon("java-swing-tutorial.JPG");
    JTabbedPane tabPaneJTP = new JTabbedPane();
    JPanel lengthPNL = tabContents(lengthUnits);
    tabPaneJTP.addTab("Length", lengthICN, lengthPNL);
    tabPaneJTP.setSelectedIndex(0);
    JPanel areaPNL = tabContents(areaUnits);
    tabPaneJTP.addTab("Area", areaICN, areaPNL);
    JPanel massPNL = tabContents(massUnits);
    tabPaneJTP.addTab("Mass", massICN, massPNL);
    JPanel volumePNL = tabContents(volumeUnits);
    tabPaneJTP.addTab("Volume", volumeICN, volumePNL);
    JPanel tempPNL = tabContents(tempUnits);
    tabPaneJTP.addTab("Temperature", tempICN, tempPNL);
    //Add the tabbed pane to this panel.
    setLayout(new GridLayout(1, 1));
    add(tabPaneJTP);
    protected JPanel tabContents(String[] units)
    JPanel tabPNL = new JPanel();
    JTextField[] unitTFs = new JTextField[units.length];
    JLabel[] unitLs = new JLabel[units.length];
    for (int i = 0; i < units.length; i++)
    unitTFs[i] = new JTextField("0");
    unitLs[i] = new JLabel(units);
    tabPNL.add(unitTFs[i]);
    tabPNL.add(unitLs[i]);
    tabPNL.setLayout(new GridLayout(units.length, 1));
    return tabPNL;
    private class CmHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
    double cm, m;
    cm = Double.parseDouble(unitTFs[0].getText());
    public static void main(String[] args)
    JFrame frame = new JFrame("Unit Converter Demo");
    frame.getContentPane().add(new UnitConverter(), BorderLayout.CENTER);
    frame.setSize(500, 500);
    frame.setVisible(true);

    Variables only have scope in the method (or block) in which they are created. That means if you create a variable in one function, you can't use it in another.
    If you want to use a variable in two different functions, you have to make it a member variable.
    [Declaring Member Variables|http://java.sun.com/docs/books/tutorial/java/javaOO/variables.html]

  • Difficulty level slider bar

    Hello I need to implement a slider bar to my game to be able to change its difficulty level. Right now my game is about a creature appearing and disapearing in a panel every second randomly. If I'm able to click on the creature when it appear I gain a point. I need to slider so the user can change the speed of the creature appearing and disapearing.
    This is what i have.
    public class Creature implements ActionListener{
         private GamePanel gamePanel;
         private int x = 250;
         private int y = 250;
         private ImageIcon image = new ImageIcon("creature.gif");
         private boolean visible = true;
         private Random random = new Random();
         private Timer timer; //= new Timer(1000, this);
         //private int numberOfTimeCreatureIsCaught = 0;
         public Creature(GamePanel gamePanel){
              this.gamePanel = gamePanel;
              timer = new Timer(1000, this);
              timer.start();
         public void draw(Graphics g){
              if(visible){
              image.paintIcon(gamePanel, g, x, y);
         public void actionPerformed(ActionEvent e){
              int delay = random.nextInt(1000) + 1;
              timer.setDelay(delay);
              if(visible)
                   visible = false;
              else{
                   visible = true;     
                   x = random.nextInt(500 - 80);
                   y = random.nextInt(500 - 67);
              gamePanel.repaint();
         public boolean isClicked(int a, int b)
              if(a > x + 80) return false;
              if(a < x) return false;
              if(b > y + 67) return false;
              if(b < y) return false;
              return true;
    }Thank you

    Learn about concepts like "data model" and "controller".
    Write your program in a way that it always knows what it should look like (model), this model is updated every second-or-so, and the GUI is then notified to update itself.
    Which doesn't have anything to do with your slider problem, I know. But you haven't really told us what your problem actually is.

  • HT5012 I am having difficulty XMIT/REC text messages to family members using Android phones?  I have a 3GB data plan and all switches and buttons are set properly.  Any suggestions?

    I am having difficulty XMIT/REC text messages to family members using Android phones?  I have a 3GB data plan and all switches and buttons are set properly.  Any suggestions?

        Hello APVzW, we absolutely want the best path to resolution. My apologies for multiple attempts of replacing the device. We'd like to verify the order information and see if we can locate the tracking number. Please send a direct message with the order number so we can dive deeper. Here's steps to send a direct message: http://vz.to/1b8XnPy We look forward to hearing from you soon.
    WiltonA_VZW
    VZW Support
    Follow us on twitter @VZWSupport

  • Can not add a picture to the JFrame from an ActionListener class

    As topic says, I can not add a picture to the JFrame from an ActionListener class which is a class inside the JFrame class.
    I have a Map.java class where I load an image with ImageIcon chosen with JFileChooser.
    I my window class (main class), I have following:
    class OpenImage_Listener implements ActionListener
         public void actionPerformed(ActionEvent e)
              int ans = open.showOpenDialog(MainProgram.this);     // "open" is the JFileChooser reference
              if(ans == open.APPROVE_OPTION)
                   File file = open.getSelectedFile();                    
                   MainProgram.this.add(new Map(file.getName()), BorderLayout.CENTER);     // this line does not work - it does not add the choosen picture on the window,
                            //but if I add the picture outside this listener class and inside the MainProgram constructor, the picture apperas, but then I cannot use the JFileChooser.
                            showMessageDialog(MainProgram.this, fil.getName() ,"It works", INFORMATION_MESSAGE);  // this popup works, and thereby the ActionListener also works.
    }So why can�t I add a picture to the window from the above listener class?

    The SSCCE:
    Ok, I think I solved it with the picture, but now I cannot add new components after adding the picture.
    Look at the comment in the actionlistener class:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test extends JFrame{
         JButton b = new JButton("Open");
         JFileChooser jfc = new JFileChooser(System.getProperty("user.dir"));
         Picture pane;
         Test(){
              super("Main Program");
              setLayout(new BorderLayout());
              JPanel north = new JPanel();
              add(north, BorderLayout.NORTH);
              north.add(b);
              b.addActionListener(new Listener());
              setVisible(true);
              setSize(500,500);
              pane = new Picture("");
              add(pane, BorderLayout.CENTER);
         class Listener implements ActionListener {
              public void actionPerformed(ActionEvent e){
                   int ans = jfc.showOpenDialog(Test.this);
                   if(ans == jfc.APPROVE_OPTION)
                        File file = jfc.getSelectedFile();
                        Test.this.add(new Picture(file.getName()), BorderLayout.CENTER);
                        pane.add(new JButton("NEW BUTTON")); // Why does this button not appear on the window???
                        pane.repaint();
                        pane.revalidate();
         public static void main(String[] args)
              Test t = new Test();
    class Picture extends JPanel
         Image pic;
         String filename;
         Picture(String filename)
              setLayout(null);
              this.filename = filename;
              pic = Toolkit.getDefaultToolkit().getImage(filename);
            protected void paintComponent(Graphics g)
                super.paintComponent(g);
                g.drawImage(pic,0,0,getWidth(),getHeight(),this);
                revalidate();
    }

  • Difficulty downloding Adobe Reader and Error 1327. Invalid Drive H:\

    I am having a difficulty downloading Adobe reader on my laptop. For some reasons, I am getting error 1327. Invalid Drive H:\ notification. I have followed the tips on how to resolve this issue from Adobe's help and FAQ pages, but I am still not able to download Adobe reader. This issue begun short while after I installed a Tuneup software from AVG. I contacted this Tuneup company, and one of it's representative guided me through the steps on how to resolve the problem; unfortunately, the correction attempt did not make any difference. Adobe tech support team can fix my issue, but at a cost of $ 40. I do not want to pay it. Hence, I am trying to solve this problem myself. Could any one, who has the knowledge to deal with this issue, please respond to my request?
    Thank you in advance for your assistance. I look forward to hearing from you.
    Best regards,
    Peter VK Mayangi

    Have you tried both solutions on the link from the earlier poster?  Microsoft Fixit did not fixit?
    If so, you will have to search the registry manually for your invalid drive H:\
    Please post back if you are unsure what to do when you find that registry entry.
    P.S. please do not post your email address and other private data in this public forum!

  • 'we had difficulty reading this feed. host parameter is null' I am getting no where here, help!?

    I've had an RSS feed created for an online video podcast but keep getting the message: 'we had difficulty reading this feed. host parameter is null' i've looked at the forums but none of them make any sense. My IT team say the RSS feed is valid and it should work and that is more like down to an itunes error, any help?

    This will be our first podcast so do not currently have a page. Below is the feed.
    Thank you Roger.
    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    <atom:link href="http://dmsukltd.com/rss/rss.xml" rel="self" type="application/rss+xml" />
    <title>The Big Picture</title>
    <link>http://www.dmsukltd.com/hawk/dms_big_picture/</link>
    <description>A brand new monthly movie show produced by DMS</description>
    <language>en-gb</language>
    <item>
    <title>The Big Picture: Mission: Impossible-Ghost Protocol first podcast</title>
    <link>http://dmsukltd.com/dl/paramount/tbp_mi4gp_uk_premiere_v1_qt_hires.mov</link>
    <guid>http://dmsukltd.com/dl/paramount/tbp_mi4gp_uk_premiere_v1_qt_hires.mov</guid>
    <pubDate>15 Dec 2011 12:00:00 GMT</pubDate>
    <description>[CDATA[The cast of Mission Impossible - Ghost Protocol joined The Big Picture on the red carpet for the films UK Premiere! Tom Cruise, Simon Pegg, Paula Patton and Samuli Edelmann were on hand to talk about this latest chapter of the popular series!]]</description>
    </item>
    </channel>
    </rss>

  • "We had difficulty reading this feed. null" Atom feeds no longer work?

    Hi - our Audioboo feeds used to work fine when submitting as a podcast (eg http://audioboo.fm/users/4705/boos.atom). It seems like they stopped working recently - maybe in the past couple of days - and just report "We had difficulty reading this feed. null" when you try to submit them.
    I'm beginning to suspect that the use of atom rather than rss is the cause. Can anyone confirm?
    -Jonathan

    This feed can be subscribed to manually in iTunes (from the 'Advanced' menu) - actually I'm rather surprised it works because it isn't a valid podcast feed (though it is a valid Atom feed).
    It has the iTunes 'declaration' and some itunes tags, although the former is contained in a 'feed' tag whereas it should be a 'rss' tag: there is no 'channel' tag enclosing the podcast data, no 'item' tags enclosing each episode, and no 'enclosure' tags within each episode containing the media URL. I'm not surprised you can't submit it as a podcast, and as I say it's a but surprising that the iTunes application recognizes it.
    In order to get it accepted in the iTunes Store you need to create a feed in the correct format: this page contains a sample basic feed so you can see how it should look:
    http://www.wilmut.org.uk/pc
    If the feed contains the valid iTunes format it can also contain atom tags, which iTunes will ignore.

  • Difficulty detecting SATA disk, adding a second SATA disk, memory conflict, etc

    I resolved the SATA problem in the middle of writing this post, but for others’ benefit in the future, I am still describing it here.  But there are still some unresolved problems.
    ========================================================
    I have an Intel P4 2.4 GHz CPU.
    My MSI motherboard has the words 865PE Neon 2P on it.
    BIOS is AmiBIOS 3.31a.
    I cannot tell what display card I have.  I do not see any brand printed on the card.
    I have an (internal) 37 GB IDE hard disk (I cannot see the brand and I am too lazy to un-mount it) as the C drive.
    About 3 years ago I added another internal disk, 150GB Western Digital WD 1600, SATA as the E drive.
    I have a copy of Windows XP Pro SP2 on each of these two hard drives but I always boot on C.
    I also have 2 DVD drives (Drives D and G) and 6 (2 at the side and 4 at the back) USB ports.
    A shop installed everything for me and things have been well.  I did not record the BIOS settings so I do not know how it was set up.  My nightmare started about 2 weeks ago when my PC suddenly did not detect E, i.e. the SATA drive.  I had not done anything to the BIOS setting or otherwise, so I have no idea why the E drive suddenly disappeared. 
    At that time, the Standard CMOS Features in the BIOS setting was:
    Primary IDE Master - Not Installed
    Primary IDE Slave - IC35L060AVV207-0
    Secondary IDE Master - Pioneer DVD ROM
    Secondary IDE Slave - Lite On DVD ROM
    Third IDE Master - Not Installed
    Third IDE Slave - Not Installed
    Fourth IDE Master - Not Installed
    Fourth IDE Slave - Not Installed
    I tried many things and finally bought a hard disk enclosure and put that SATA in it and connect it to one of the USB ports.  It works.
    This morning I stumbled on this article "Motherboard can't detect SATA hard disk" at http://forum.msi.com.tw/index.php?topic=119738.0 and also “Q: How to enable both SATA and PATA? “ on “NEO Boards Unofficial FAQ rev 4/05/2004 - two lights on "P" series” at https://forum-en.msi.com/index.php?topic=21469.0 taking about the On-Chip IDE Configuration section of  the BIOS menu and I decided to give it a try, so that I can get rid of that hard disk enclosure.
    It works, kind of.  I saw that it was set to Legacy Mode, P-ATA Only, SATA Keep Enabled=No, PATA Keep Enabled=No, PATA Channel Selection=Both, Combined Mode Option=PATA 1st Channel, SATA Ports Definition= P0-3rd/P1-4th. So following the advice on the article and the FAQ, I reset it to Legacy Mode, P-ATA + S-ATA, SATA Keep Enabled=No, PATA Keep Enabled=No, PATA Channel Selection=Both, Combined Mode Option=PATA 1st Channel, SATA Ports Definition= P0-Master/P1-Slave.  Now my PC could detect the SATA drive and set it as the D drive (and the IDE remained as Drive C) but my two DVD ROMs disappeared.  The Standard CMOS Features in the BIOS setting was:
    Primary IDE Slave - IC35L060AVV207-0
    Secondary IDE Master - WDC WD1600JD-00HBB
    The rest is Not Installed.
    So, I (only) changed Combined Mode Option to SATA 1st Channel. So apparently my PC now booted using the WinXP copy on the SATA disk (recall that I have WinXP on both hard disks).  And now the SATA disk is C, and both DVD ROMs are visible.  My IDE disk disappeared.
    Now I went back to the BIOS menu and switched back to PATA 1st Channel, reset it back to P-ATA Only, and changed SATA Keep Enabled=Yes.  Voila.  Now I can see my IDE disk as Drive C, SATA disk as Drive D, the two DVD ROMs as Drives E and G.  Everything looks fine except that some of the start-up programs no longer start up apparently because their paths used to be E:\.... but now the disk they are on was renamed from E to D so the operating system cannot locate them.  And the Standard CMOS Features menu reads:
    Primary IDE Master - Not Installed
    Primary IDE Slave - IC35L060AVV207-0
    Secondary IDE Master - Pioneer DVD ROM
    Secondary IDE Slave - Lite On DVD ROM
    Third IDE Master - Not Installed
    Third IDE Slave - Not Installed
    Fourth IDE Master - WDC WD1600JD-00HBB
    Fourth IDE Slave - Not Installed
    Problem 1 (the main problem): Difficulty detecting SATA disk – Resolved.  If anyone is kind enough, maybe you can tell me and others why suddenly the BIOS setting was changed by itself causing all these problems, and why “P-ATA Only, SATA Keep Enabled=Yes” works but “P-ATA + S-ATA, SATA Keep Enabled=No” does not.  Should I now tweak the Windows registry to change the drive letter of the SATA disk from D to E? 
    Problem 2: I just bought an internal Hitachi Deskstar 640GB SATA disk.  And I have a vacant orange SATA connector on my mobo.  Can I add it together with the existing 2?  Would it be set up as Third IDE Master, Fourth IDE Slave, or something else?
    Problem 3: I used to have a Samsung DDR PC2700 512MB memory module and during the last week I added a Corsair DDR PC3200 1GB memory module, both on the green slots (not the purple slots).  It caused my PC to freeze (keyboard and mouse not responsive) every now and then.  So I pulled out the Samsung one and it has been working fine.  Some said one has to use memory from the same manufacturer with the same size and same everything.  The sticky thread titled “NEO Boards Unofficial FAQ rev 4/05/2004 - two lights on "P" series” in this forum has a question “I have this RAM xxxx but it does not work with my board. Can MSI update the BIOS to fix this?” and the answer points to a Product Info page and I don’t know where that is. Any advice on how to make both work together?  Can I use the purple slots?
    Problem 4: The “usable” space on my Dell M991 CRT monitor has shrunk.  That is, the black areas on both sides, mostly RHS, have intermittently enlarged.  It only happened in these 2 weeks. I tried Control Panel – Display – Settings – Advanced – Displays – Adjustments to no avail.  I don’t have another monitor to try in order to test whether it has to do with the CRT.  Just in case you happen to know anything, please jot a line.
    Problem 5: Some of my USB ports do not work or only work intermittently.  For example I plugged in my wireless adaptor into one of them and it sometimes would say “USB Device Not Recognized”.

    Quote
    If anyone is kind enough, maybe you can tell me and others why suddenly the BIOS setting was changed by itself causing all these problems, and why “P-ATA Only, SATA Keep Enabled=Yes” works but “P-ATA + S-ATA, SATA Keep Enabled=No” does not.
    Maybe your CMOS Battery is running low and it is time to replace it.
    Quote
    Should I now tweak the Windows registry to change the drive letter of the SATA disk from D to E? 
    Try to change drive letters via the Windows Drive Manager:
    http://www.mvps.org/marksxp/WindowsXP/driveltr.php
    Quote
    Problem 2: I just bought an internal Hitachi Deskstar 640GB SATA disk.  And I have a vacant orange SATA connector on my mobo.  Can I add it together with the existing 2?
    If it is a SATA-II Drive, you will probably have to force it into SATA-I Compatibility mode first (check the hard drive user manual for jumper settings or firmware switches).
    Quote
    I used to have a Samsung DDR PC2700 512MB memory module and during the last week I added a Corsair DDR PC3200 1GB memory module, both on the green slots (not the purple slots).  It caused my PC to freeze (keyboard and mouse not responsive) every now and then.  So I pulled out the Samsung one and it has been working fine.  Some said one has to use memory from the same manufacturer with the same size and same everything.
    Exactly.  Mixing different memory modules causes problems in many cases because the exact same settings will apply to both modules at the same time.  What works for the one module may not work so well for the other one.
    Quote
    Just in case you happen to know anything, please jot a line.
    That is either related to the monitor itself or to the video card.  It may also be related to a problem with the driver or improper screen resolution settings.
    Quote
    Problem 5: Some of my USB ports do not work or only work intermittently.  For example I plugged in my wireless adaptor into one of them and it sometimes would say “USB Device Not Recognized”.
    What ports? Front Panel or Back Panel?

  • ActionListener not working with JFrame

    Hi,
    I've just rehashed an old bit of code to work with a new application but for some reason the JButton ActionListeners aren't working. However if I extend JDialog they work ok. The current code for JDialog is:-
    * File:     GUI.java
    * @author           ODL 3xx Distributed Systems - Team x
    * @description      This class provides a means for the user to
    *                    interact with file server.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class GUI extends JDialog implements ActionListener, ApplicationConstants {
        private JLabel label1, label2, label3, label4, label5;
        private JTextField field1, field2, field3, field4, field5;
        private JButton button1, button2, button3, button4, button5;
        private Container container;
        private Message sendFile;
        private String id;
        private String defaultText = "Enter file name here";
        private ClientForGUI client;
        private long timeStart, timeEnd;
        public GUI(JFrame frame) {
            super(frame, "File Server Actions", true);
            client = new ClientForGUI(this);
            try{
                   InetAddress addr = InetAddress.getLocalHost();
                   id = addr.getHostName() + Long.toString((new java.util.Date()).getTime());
                   if(client.connectToServer())
                   initGUI();
                   else{
                        JOptionPane.showMessageDialog(this, "Unable to connect to server", "Error", JOptionPane.WARNING_MESSAGE);
                        System.exit(0);
              catch(UnknownHostException uhe){
                   System.out.println("Unknown Host Exception");
            initGUI();
         * Create the GUI
        private void initGUI() {
            container = this.getContentPane();
            container.setLayout(null);
            label1 = new JLabel("Upload File");
            label2 = new JLabel("Rename File");
            label3 = new JLabel("Delete File");
            label4 = new JLabel("Create File");
            label5 = new JLabel("Download File");
            field1 = new JTextField();
            field2 = new JTextField();
            field3 = new JTextField();
            field4 = new JTextField();
            field5 = new JTextField();
            button1 = new JButton("Upload");
            button2 = new JButton("Rename");
            button3 = new JButton("Delete");
            button4 = new JButton("Create");
            button5 = new JButton("Download");
            label1.setBounds(10,10,80,20);
            label2.setBounds(10,40,80,20);
            label3.setBounds(10,70,80,20);
            label4.setBounds(10,100,80,20);
            label5.setBounds(10,130,80,20);
            field1.setBounds(100,40,200,20);
            field1.setText("Old name");
            field2.setBounds(310,40,200,20);
            field2.setText("New name");
            field3.setBounds(100,70,410,20);
            field3.setText(defaultText);
            field4.setBounds(100,100,410,20);
            field4.setText(defaultText);
            field5.setBounds(100,130,410,20);
            field5.setText(defaultText);
            button1.setBounds(100,10,100,20);
            button1.addActionListener(this);
            button2.setBounds(520,40,100,20);
            button2.addActionListener(this);
            button3.setBounds(520,70,100,20);
            button3.addActionListener(this);
            button4.setBounds(520,100,100,20);
            button4.addActionListener(this);
            button5.setBounds(520,130,100,20);
            button5.addActionListener(this);
            container.add(label1);
            container.add(button1);
            container.add(label2);
            container.add(field1);
            container.add(field2);
            container.add(button2);
            container.add(label3);
            container.add(field3);
            container.add(button3);
            container.add(label4);
            container.add(field4);
            container.add(button4);
            container.add(label5);
            container.add(field5);
            container.add(button5);
            setSize(640,200);
            setResizable(false);
            //Centre on the screen
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
              int x = (int) ((d.getWidth() - getWidth()) / 2);
              int y = (int) ((d.getHeight() - getHeight()) / 2);
              setLocation(x,y);
            setVisible(true);
        private void sendMessageToServer(Message message){
             message.setId(id);
             timeStart = new java.util.Date().getTime();
             try{
                  client.sendMessageToServer(message);
             catch(IOException ioe){
                  System.out.println("Unable to send message to server");
          * Perform some action based on user interaction
          * @param ae - ActionEvent
        public void actionPerformed(ActionEvent e){
            Object o = e.getSource();
            String name;
            if(o == button1){
                 try{
                        JFileChooser fc = new JFileChooser();
                       fc.setVisible(true);
                      //return value is what the user presses in the open File dialog
                      int returnVal = fc.showOpenDialog(null);
                      //if they choose OK
                      if (returnVal == JFileChooser.APPROVE_OPTION) {
                             //file now references the selected
                             File file = fc.getSelectedFile();
                             //create a FileInputStream from file location
                             FileInputStream fis = new FileInputStream(file);
                             // Create the byte array to hold the data, the same size as the file
                             byte [] fileBytes = new byte[(int)file.length()];
                              // Read in the bytes from the file into the byte array
                              int offset = 0;
                              int numRead = 0;
                              while (offset < fileBytes.length &&
                             (numRead=fis.read(fileBytes, offset, fileBytes.length-offset)) >=
                             0) {
                                  offset += numRead;
                             // Ensure all the bytes have been read in
                             if (offset < fileBytes.length) {
                                  throw new IOException("Could not completely read file "+file.getName());
                             fis.close();
                             sendFile = new Message(SEND_FILE, fileBytes);
                             sendFile.setId(id);
                             sendFile.setFileName(file.getName());
                             byte [] myarray = ConvertData.messageToBytes(sendFile);
                             Message sendWarning = new Message(SEND_FILE_WARNING);
                               sendWarning.setFileName(file.getName());
                              sendWarning.setFileSize(myarray.length);
                              try{
                                    sendMessageToServer(sendWarning);
                               catch(Exception excep){
                                    System.out.println(excep);
                   catch(FileNotFoundException fnfe){
                        System.out.println("File Not Found Exception");
                   catch(java.io.IOException ioe){
                        System.out.println("IO Exception");
            else if(o == button2){
                   name = field1.getText();
                   String name2 = field2.getText();
                   Message renameMessage = new Message(RENAME_FILE);
                   renameMessage.setFileName(name);
                   renameMessage.setFileRename(name2);
                   sendMessageToServer(renameMessage);
                   field1.setText("Old name");
                   field2.setText("New name");
            else if(o == button3){
                   name = field3.getText();
                   Message deleteMessage = new Message(DELETE_FILE);
                   deleteMessage.setFileName(name);
                   sendMessageToServer(deleteMessage);
                   field3.setText(defaultText);
            else if(o == button4){
                   name = field4.getText();
                   Message createMessage = new Message(CREATE_FILE);
                   createMessage.setFileName(name);
                   sendMessageToServer(createMessage);     
                   field4.setText(defaultText);     
            else if(o == button5){
                   name = field5.getText();
                   Message downloadMessage = new Message(REQUEST_FILE);
                   downloadMessage.setFileName(name);
                   sendMessageToServer(downloadMessage);
                   field5.setText(defaultText);          
        public void processServerMessage(Message message){
             switch(message.getMessageHeader()){
                   case SEND_FILE_WARNING:
                   //change the download size to file size plus max message size
                   client.setDownload((int)message.getFileSize(),true);
                   //turn message back around with acknowledgement header
                   message.setMessageHeader(SEND_FILE_ACK);
                   //send the message
                   try{
                        sendMessageToServer(message);
                   catch(Exception e){
                        System.out.println(e);
                   break;
                   //server has acknowledged that the client wishes to send a message
                   //so send the message
                   case SEND_FILE_ACK:
                   //send the message
                   try{
                        sendMessageToServer(sendFile);
                   catch(Exception e){
                        System.out.println(e);
                   break;
                   //server is sending the file to the client.
                   case SEND_FILE:
                   //reset the download size to default
                   client.setDownload(DEFAULT_MESSAGE_SIZE,false);
                   //get the file name
                   File f = new File(message.getFileName());
                   //create the file chooser
                   JFileChooser fc = new JFileChooser();
                   //set selected file as thoe one downloaded
                   fc.setSelectedFile(f);
                   //get the button hit by the user
                 int returnVal = fc.showSaveDialog(null);
                 //if button is OK
                  if (returnVal == JFileChooser.APPROVE_OPTION){
                       File temp = fc.getCurrentDirectory();
                       String [] files = temp.list();
                       java.util.List alist = java.util.Arrays.asList(files);
                       f = fc.getSelectedFile();
                       if(alist.contains(message.getFileName())){
                            if(JOptionPane.showConfirmDialog(null,
                                       message.getFileName() + " already exists. Are you sure you want to overwrite this file?",
                                       "Instant Messenger: Quit Program",
                                       JOptionPane.YES_NO_OPTION,
                                       JOptionPane.QUESTION_MESSAGE,
                                       null) == JOptionPane.YES_OPTION) {
                                            //f = fc.getSelectedFile();
                                            System.out.println(f.toString());
                                           //this is where the file is copied
                                           try{
                                                FileOutputStream fs = new FileOutputStream(f);
                                                 fs.write(message.getFile());
                                                 fs.close();
                                           catch(IOException e){
                                                System.out.println(e);
                            else fc.hide();
                       else{
                            System.out.println("Here " + f.toString());
                            try{
                                 FileOutputStream fs = new FileOutputStream(f);
                                  fs.write(message.getFile());
                                  fs.close();
                            catch(IOException e){
                                 System.out.println(e);
                  else fc.hide();
                  break;
                  case INFORMATION:
                  timeEnd = new java.util.Date().getTime();
                  Long rtrip = timeEnd - timeStart;
                  String str = Long.toString(rtrip);
                  double d = Double.valueOf(str).doubleValue();
                  String fullMessage = message.getMessage();
                  fullMessage += " The total time taken for the last request was " +
                  rtrip + " milliseconds" + " or roughly " + d/1000 + " seconds";
                   JOptionPane.showMessageDialog(null,fullMessage,"Information",JOptionPane.INFORMATION_MESSAGE);
                   break;          
    class TestGUI{
        public static void main(String [] args){
             JFrame frame = new JFrame();
             GUI myGUI = new GUI(frame);
    }     If I change the GUI constructor to empty and extend JFrame instead of JDialog and change the call to super the ActionListener stops working. I've never known this problem before (i.e. I always use e.getSource()). I've even cast the object to a JButton to ensure that the right button is pressed and it is all ok.
    Is there something fundamentally wrong when I make those simple changes to JFrame?
    Regards,
    Chris

    I think rather the approach is your action handling in terms of the buttons. The giant actionPerformed method is difficult to read and maintain.
    I would recommend the following things:
    1. Split your ActionListener into multiple smaller listeners. There's not really even a reason for the GUI class to be an action listener. Instead of having GUI implement ActionListener and trying to keep all of the functionality in one place, use anonymous classes:
    button3.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent e)
            name = field3.getText();
            Message deleteMessage = new Message(DELETE_FILE);
            deleteMessage.setFileName(name);
            sendMessageToServer(deleteMessage);
            field3.setText(defaultText);
    button4.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent e)
            name = field4.getText();
            Message createMessage = new Message(CREATE_FILE);
            createMessage.setFileName(name);
            sendMessageToServer(createMessage);     
            field4.setText(defaultText);
    2. Only use the == operator on primitives. There are very few cases in which you can properly use the == operator on objects and, in every one of those cases I have experienced, the equals(Object) method produces the same result.
    3. Name your variables more descriptively. There is really very little reason for your buttons to be named button1, button2, and so on. Give them names that mean something. For example, button1 should be named something like uploadFileButton or buttonUpload. That will give us significant information about what it is expected to do, whereas button1 does not. You may be able to remember what button1 does, but you wrote the code. I keep having to refer back to the instantiation of the button to get a hint as to what it does and, in a few months' time, so will you. :) The same goes for your labels and fields, as well.
    I'm not sure why you aren't getting the behavior you want. However, have you checked to determine that the event source of the button click is actually the button when the whole thing is inside of a JFrame? I would expect it to be, but you never know. This is why I recommend using different ActionListeners for each button. That way, you can be sure of what caused the event.
    Just my 2c. Good luck to you. :)

  • I am having difficulty: we are running a windows server 2003 - mail and outlook support 2007 and upwards, how do I get the brand new apple machines to work with the 2003 version of server

    I am having difficulty: we are running a windows server 2003 - mail and outlook support 2007 and upwards, how do I get the brand new apple machines to work with the 2003 version of server

    I may be way out, but do you know about this product, would it help integrate the Macs for you.
    https://www.thursby.com/sites/default/files/images/ADmitMacv8_SPD.pdf

  • Problem with ActionListener

    Hi
    i have coded a button and added a Actionlistner that when the button is pressed then it should repaint the dice.but I don't know why it is not working.
    here i my code
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.ImageIcon;
    public class Board {
    JFrame frame;
    //Image dice[] = new Image[2];
    //int stick1,stick2,stick3,stick4,stick5;
    //boolean begin = true;
    Stick st = new Stick();
    public static void main(String[] args) {
         Board b = new Board();
         b.go();
        public void go() {
            //Make sure we have nice window decorations.
           JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("Senet");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel jp = new JPanel();
            JButton button = new JButton("Make Move");
            button.addActionListener((ActionListener) new Stick());
          Stick st = new Stick();
            //frame.getContentPane().add(BorderLayout.EAST,button);
           frame.getContentPane().add(BorderLayout.CENTER,jp);
           jp.setBackground(Color.DARK_GRAY);
           jp.setLayout(new BoxLayout(jp,BoxLayout.Y_AXIS));
           Check c = new Check();
           jp.add(c);
           jp.add(st);
           st.add(button);
          st.setBackground(Color.WHITE);
            //Display the window.
            frame.setSize(600,500);
            frame.setVisible(true);
       /* public void actionPerformed(ActionEvent event){
             st.repaint();
    import javax.swing.*;
    import java.awt.*;
    import java.awt.Graphics.*;
    import java.awt.event.*;
    * @author Kokil Bhalerao
    public class Stick extends JPanel implements ActionListener{
          Image dice[] = new Image[2];
          int stick1, stick2,stick3,stick4,stick5, result;
          boolean begin = true;
          public void actionPerformed(ActionEvent event){
                  repaint();
          public void paintComponent(Graphics g)
               super.paintComponent(g);
               Graphics2D g2 = (Graphics2D)g;
               dice = new Image[2];
                  dice[0] = new ImageIcon("C:/Program Files/Java/images/stick2.gif").getImage();
                    dice[1] = new ImageIcon("C:/Program Files/Java/images/stick1.gif").getImage();
                    begin = false;
                       stick1 = (int)(Math.random() * 2 + 1);
                      stick2 = (int)(Math.random() * 2 + 1);
                      stick3 = (int)(Math.random() * 2 + 1);
                      stick4 = (int)(Math.random() * 2 + 1);
                      stick5 = (int)(Math.random() * 2 + 1);
                     setAll(stick1,stick2,stick3,stick4,stick5,begin);
               // draw dice if they've clicked the roll button at least once
               if (!begin)
                   g2.drawImage(dice[stick1 - 1], 20, 40,100,50,this);
                  g2.drawImage(dice[stick2 - 1], 120, 40,100,50,this);
                  g2.drawImage(dice[stick3 - 1], 220, 40,100,50,this);
                  g2.drawImage(dice[stick4 - 1], 320, 40,100,50,this);
                  g2.drawImage(dice[stick5 - 1], 420,40,100,50,this);
               else
                  g2.drawString("Welcome to senet", 20, 60);
            public void setImages(Image s[])
               dice = s;
            public void setAll(int s1,int s2,int s3,int s4,int s5,boolean b)
                 stick1 = s1;
                 stick2 = s2;
                 stick3 = s3;
                 stick4 = s4;
                 stick5 = s5;
                 begin = b;
    public class Check extends JPanel{
         public void paint(Graphics g) {
            int row;   // Row number, from 0 to 7
            int col;   // Column number, from 0 to 7
            int x,y;   // Top-left corner of square
            Image bg = new ImageIcon("C:/Program Files/Java/images/piece1.gif").getImage();
            for ( row = 0;  row < 3;  row++ ) {
               for ( col = 0;  col < 10;  col++) {
                  x = col * 60;
                  y = row * 60;
                     g.setColor(Color.black);
                  g.drawRect(x, y, 60, 60);
                  g.setColor(Color.blue);
                 g.fillRect(x+1, y+1, 60, 60);
                  if( row == 0 )
                 g.drawImage(bg, x+5,y+5,40,40,Color.RED, this);
            } // end for row
         }  // end paint()Please somebody help me with this.
    Thanks

    thanks for the reply. but i don't know how i can do
    that.So the code above is not yours ?
    http://java.sun.com/docs/books/tutorial/java/index.html

  • New customer - Difficulty Getting Support

    Prior to becoming a customer today, I had no problems with getting in contact with Verizon via chat. Now that I am a customer, I'm having a difficult time getting support. EVERY avenue of Verizon support is busy -- long hold times on the phone, no chat representatives available (all assisting others), long wait times in the store.
    I had to provide additional documentation to get my account setup, and I was not informed that I would need additional documentation when I first came to the Verizon store on Feb. 21. I am porting over from another carrier, and got the go ahead from the other carrier on Feb. 28 to be able to switch. I came in to a Verizon store on Feb. 28 to setup service, but the computer system automatically placed a hold on the account and I had to provide additional documentation.
    I could not get that documentation and come back before the store closed for the night. I came back March 1, and had to end up paying a higher price for the phone. I am fairly certain that in the month of February, the Droid MAXX was $99.99 and I can at least confirm that by using web.archive.org and looking back to Feb. 25 where it does show that price with a 2-year contract. Going to verizonwireless.com today now shows the phone for $149.99.
    The difficulty in getting support lies with not being able to get the price adjusted in the store. I went to another store, and after being there for at least 20 minutes, I hadn't moved up in the queue. I tried online chat, but all agents were busy. I called phone support, but encountered a wait for assistance on the phone. I lastly tried Twitter support, but it seems the VZWSupport account was last active on Feb. 26.

    c_brookhart wrote:
    I managed to get in contact with customer service by phone. I've had good experience using social media to get assistance from my previous carrier. Verizon seems to have two support accounts on Twitter - VerizonSupport and VZWSupport; which one is the correct one?
    VerizonSupport = Verizon Landline services (phone, Fios, DSL, etc.)
    VZWSupport = Verizon Wireless (cellular phone)

  • I can't get pages 5.01 to open pages files from iCloud, although they open in iCloud Pages without difficulty.

    I can't get Pages 5.01 to open Pages files from iCloud, although they open in iCloud Pages without difficulty.
    I am using the most up to date version of Mavericks and Pages and can log into iCloud without any problems.  Is this just a glitch?  The files all behaved properly under previous versions and the initial release of the new version of Pages.

    Pages for iCloud beta is a weird beast and as it says "beta".
    I think it is the least compatible of all the many different .pages files floating around out there.
    Peter

  • Strange error while using ActionListener with RichCommandLink

    Hi,
    I am using Technology preview 3.
    I have RichTable bound to af:table in my JSF page.
    I am showing database contents inside richTable.
    Inside richTable i have one extra column in which i am showing remove link. So every row of table will have remove link. I have added ActionListener as inner class for the backing bean. and this actionlistener i am adding into RichCommandLink(remove link)
    But when i click on remove link I am getting weired exception. And i am not able to get why this error is coming.
    This problem occures whenever I use contentDelivery parameter with <af:table>
    Here is the stack trace of the error.
    java.lang.InstantiationException: com.backingBean.UpdateSampleTypeB
    ackingBean$MyLinkActionListener
    at java.lang.Class.newInstance0(Class.java:335)
    at java.lang.Class.newInstance(Class.java:303)
    at org.apache.myfaces.trinidad.bean.util.StateUtils$Saver.restoreState(S
    tateUtils.java:286)
    at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreStateHolder(S
    tateUtils.java:202)
    at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreList(StateUti
    ls.java:257)
    at org.apache.myfaces.trinidad.bean.PropertyKey.restoreValue(PropertyKey
    .java:231)
    at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUt
    ils.java:148)
    at org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState
    (FlaggedPropertyMap.java:194)
    at org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBean
    Impl.java:358)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(U
    IXComponentBase.java:881)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:861)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at javax.faces.component.UIComponentBase.processRestoreState(UIComponent
    Base.java:1154)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeStat
    e.java:96)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestore
    State(UIXComponentBase.java:855)
    at javax.faces.component.UIComponentBase.processRestoreState(UIComponent
    Base.java:1154)
    at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.rest
    oreView(StateManagerImpl.java:487)
    at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl
    .java:287)
    at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWra
    pper.java:193)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.resto
    reView(ViewHandlerImpl.java:258)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(Li
    fecycleImpl.java:438)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(L
    ifecycleImpl.java:229)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(Lifecyc
    leImpl.java:155)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterC
    hain.java:65)
    at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilte
    r(SharedLibraryFilter.java:135)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
    istChain.doFilter(TrinidadFilterImpl.java:284)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter
    (RegistrationFilter.java:69)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
    istChain.doFilter(TrinidadFilterImpl.java:284)
    at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter
    .java:74)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterL
    istChain.doFilter(TrinidadFilterImpl.java:284)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invoke
    DoFilter(TrinidadFilterImpl.java:208)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilt
    erImpl(TrinidadFilterImpl.java:165)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilte
    r(TrinidadFilterImpl.java:138)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFi
    lter.java:92)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterC
    hain.java:15)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:1
    18)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:611)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:362)
    at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpReq
    uestHandler.java:915)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequ
    estHandler.java:821)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:626)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:599)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpReque
    stHandler.java:383)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:161)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:142)
    at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(Server
    SocketReadHandler.java:275)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(Server
    SocketAcceptHandler.java:237)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocket
    AcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(
    ServerSocketAcceptHandler.java:878)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
    utor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:675)
    Can anybody please provide any help on this?
    Regards,
    Hiren

    Hi Simon,
    I am using addActionListener method of RichCommandLink
    Here is how i am trying to use it.
    public class backingBean {
         private RichTable table;
         public backingBean() {
         RichColumn rc = new RichColumn();
         RichCommandLink cmd = new RichCommandLink();
         MyActionListener listener = new MyActionListener();
         cmd.addActionListener(listener);
         public RichTable getTable() {
         return table;
         class MyActionListener implements ActionListener {
              public void processAction (ActionEvent actionEvent) throws AbortProcessingException {
              // Processing related to edit components of backing bean
    Hiren

Maybe you are looking for