Added Jcombobox into awt.frame causing handling event function cannot receive event

Dear Sir,
I want to ask how an awt.Choice  can set the number of rows that it can display, like the method setMaximumRowCount in JCombobox. Since I want to set more row can be displayed, but choice no any method can set. And I have tried to add Jcombobox into awt.frame, then, the handling event function cannot receive event for the right-top cornet button(minimize, maximum, close).
Best Regards,

please post a Short, Self Contained, Correct Example showing your problem.
bye
TPD

Similar Messages

  • Adding ClientCertLoginModule into SOAP adapter causes problem for HTTP

    Hi there,
    We are configuring SOAP adapter to use HTTPS with client authentication
    for a B2B project. We followed note 891877 to add ClientCertLoginModule
    into service sap.com/com.sap.aii.af.soapadapter*XIOAPAdapter in the
    security provider service,
    ClientCertLoginModule, SUFFICIENT
    BasicPasswordLoginModule, SUFFICIENT
    The interface for the B2B project works fine after the change.
    But other interfaces which are using HTTP to connect to SOAP adapter
    are all failing with HTTP code 302. Because all these interfaces are
    using HTTP protocal with username/password for authentication, we
    expect they should still work because the BasicPasswordLoginModule is
    listed in the login module stack.
    Any help is much appreciated..

    Hi there,
    We are configuring SOAP adapter to use HTTPS with client authentication
    for a B2B project. We followed note 891877 to add ClientCertLoginModule
    into service sap.com/com.sap.aii.af.soapadapter*XIOAPAdapter in the
    security provider service,
    ClientCertLoginModule, SUFFICIENT
    BasicPasswordLoginModule, SUFFICIENT
    The interface for the B2B project works fine after the change.
    But other interfaces which are using HTTP to connect to SOAP adapter
    are all failing with HTTP code 302. Because all these interfaces are
    using HTTP protocal with username/password for authentication, we
    expect they should still work because the BasicPasswordLoginModule is
    listed in the login module stack.
    Any help is much appreciated..

  • Adding Data into text and graphic frames - PLEASE CAN SOMEONE HELP?

    Hello Script buddies,
    Here is my script and I want to place data into the frames which I set up already in the inDesign template which loads correctly but unable to place the data into the frames, please refer to comments and if anyone can help me I will be very grateful.
    strFile = "C:\Users\dean.brooks\Documents\PoolSigns.xlsx"
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Open strFile
    intRow = 2
    Set objSheet = objExcel.ActiveWorkbook.WorkSheets(1)
    ' Cycle through cells in Pool Sign Schedule to retreive data
    Do Until objSheet.Cells(intRow, 3).Value = ""
    PoolSignScheduleSignNo = Trim(objSheet.Cells(intRow, 1).Value)
    PoolSignScheduleTemplate = Trim(objSheet.Cells(intRow, 3).Value)
    PoolSignScheduleDepth = Trim(objSheet.Cells(intRow, 5).Value)
    PoolSignScheduleWarningFile = Trim(objSheet.Cells(intRow, 7).Value)
    PoolSignScheduleWarningText = Trim(objSheet.Cells(intRow, 8).Value)
    PoolSignScheduleRegFile = Trim(objSheet.Cells(intRow, 10).Value)
    PoolSignScheduleRegText = Trim(objSheet.Cells(intRow, 11).Value)
    ' Open InDesign Template that corresponds to PoolSignScheduleTemplate
    Set myInDesign = CreateObject("InDesign.Application.CS3")
    Set myDocument = myInDesign.Open(PoolSignScheduleTemplate)
    'Frames, these commands won't work, can someone please help??
    Set DepthMarker = myDocument.Textframes.Item
    DepthMarker.Contents = PoolSignScheduleDepth
    Set WarningText = myDocument.Textframes.Item
    WarningText.Contents = PoolSignScheduleWarningText
    Set WarningSymbol = myDocument.Graphicframes.Item
    WarningSymbol.Contents = PoolSignScheduleWarningFile
    Set RegText = myDocument.Textframes.Item
    RegText.Contents= PoolSignScheduleRegText
    ' Save InDesign File to C:\ to be moved manually later to appropriate location
    myDocument.Save("C:\Pools\PoolSign\PoolSignScheduleSignNo.indd")
    myDocument.Close
    intRow = intRow + 1
    Loop
    objExcel.Quit
    WScript.Quit

    Hi Robert,
    Your problem starts here:
    Set DepthMarker = myDocument.Textframes.Item
    ...which item? Item takes either an integer (the index of the item) or a string (the contents of the label property, if any).
    Next, however, is that you should be more specific about *where* the text frame is in the document. What page or spread is it on? Let's say that the frame "DepthMarker" is on page 1:
    Set DepthMarker = myDocument.Pages.Item(1).TextFrames.Item(1)
    If there's only one frame on that page, you're in great shape. If not, you need to come up with some way to differentiate one frame from another. Script labels are a great way to do this. Let's say you've used the Script Label panel to add the label "DepthMarker" to the relevant frame on page 1, and added the label "WarningText" to another frame. In that case, you'd use something like this:
    Set DepthMarker = myDocument.Pages.Item(1).TextFrames.Item("DepthMarker")(0)
    Set WarningText = myDocument.Pages.Item(1).TextFrames.Item("WarningText")(0)
    ...When you use a string to refer to a page item by its label, InDesign returns an array, so you need to get the first item in the array (assuming that there's only one page item on the page with that label).
    Hope this makes sense! I'm typing it off the top of my head because I have to go speak at a conference tomorrow and am short on time--but it should get you pointed in the right direction.
    Thanks,
    Ole

  • Event handler in later sequence frame is handling my event

    Consider a case where you have a sequence with two frames.  Each frame has an event handler.  If you are in frame 0 processing events, do you think that the event handler in frame 1 should have any relevance?  The attached vi demonstrates that it does.  This seems like a bug to me or at least something to watch out for.  I spent a half-day trying to figure this one out.

    kc64 wrote:
    I read the caveats and recommendations several times.  I recognize that my example vi shows two event structures in one loop but, in my application , this is not the case.  I don't see any clear instruction on that help page that would indicate that I have broken some rule of event structure use.
    That's bothersome.  I use sequences all the time and nobody has ever commented that my code is badly designed.  I wonder why NI provides that function if it promotes poor code design.  You did say "often" and not "always" so I have an out. :^)
    Well, maybe they missed something in the caveats   But using more than one Event Structure is not a good idea.
    I just posted something to that effect this morning: http://forums.ni.com/ni/board/message?board.id=170&thread.id=337440
    As for using a sequence structure (especially Stacked Sequences), I totally agree with Denis that it is poor design.  Unfortunatley, NI cannot remove them from the palette due to compatibility with older versions.  I would vote that they be removed ASAP.
    However, it is your choice to follow other people's advice or not to follow it.   

  • My ipad4 went into restore mode,cause was software crash. Genius rebooted it erasing everything,now I can't access my email. When I try to sign in it says account is already added

    Genuis had to reboot my ipad do to software Crashes unfortunetly deleting all my apps. Now I can't  access my email,when I attempt to sign in it says account is already added to iPad. I cannot receive  any mail,or even access my account. I have gone thru the troubleshooter, with no resolution .

    I would go to managing your Apple ID at this website and see if your information is all correct, first ...
    https://appleid.apple.com/
    You'll see if you can sign in on managing your Apple ID, and then if you can, you can see if your information is all correct, and then ... you should be able to go back and do it, since you've verified your information.

  • Converting an applet into a frame

    hello.
    this is james mcfadden. I am developing a 2-player BlackJack card game in java. how do i convert the following 2 pieces of code from an applet into a frame?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Blackjack extends Applet implements ActionListener,Runnable{
         private Deck deck;     //The deck...
         private Hand player_hand;//player hand
         private Hand dealer_hand;//dealer hand.
         private Button bHit=new Button("Hit");
         private Button bStay=new Button("Stay");
         private Button bRestart=new Button("New Game");
         //lets do some double buffering.
         Image offIm=null;
         Graphics offGraphics=null;
         Dimension offDimension=null;
         Image[] card_images = new Image[52];
         private boolean cards_loaded = false;
         private int current_card_loading = 0;
         String message;                         //print a message...
         int width;          //The width of the applet
         int height;          //The height of the applet
         int card_width = -1;
         int card_padding = -1;     //How much should we pad the cards by..?
         private int games=-1;     //How many games have been played?
         public void init() {
              Thread card_loader = new Thread(this);
              card_loader.start();
         public void newGame(){
              bHit.setEnabled(true);
              bStay.setEnabled(false);
              player_hand = new Hand();     //Create new hands...
              dealer_hand = new Hand();
              //shuffle the deck.
              deck.shuffleCards();
              games++;
         public void hit(){
              bStay.setEnabled(true);
              player_hand.addCard(deck.dealCard());
              if(player_hand.getValue() > 21){
                   message = "You loose! (score:"+player_hand.getValue()+")";
                   //disable the hit and stay buttons...
                   bHit.setEnabled(false);
                   bStay.setEnabled(false);
                   return;
              message = "Score: "+player_hand.getValue();     
         public void stay(){
              while(dealer_hand.getValue() < 17){
                   dealer_hand.addCard(deck.dealCard());
              if(dealer_hand.getValue() <= 21 && player_hand.getValue() < dealer_hand.getValue())
                   message = "You loose! (" + player_hand.getValue()+
                             " - "+dealer_hand.getValue()+")";
              }else if (player_hand.getValue() == dealer_hand.getValue())
                   message = "You draw! (" + player_hand.getValue()+")";
              }else {
                   message = "You win! (" + player_hand.getValue()+
                             " - "+dealer_hand.getValue()+")";
              bHit.setEnabled(false);
              bStay.setEnabled(false);
         public void actionPerformed(ActionEvent e) {
              if(e.getSource() == bRestart)
                   newGame();
              }else if (e.getSource() == bHit)
                   hit();
              }else if (e.getSource() == bStay)
                   stay();
              repaint();
         public void paint(Graphics g) {
              update(g);
         public void update(Graphics g) {
              //lets sord out double buffering
              if(offGraphics==null){
                   offIm=createImage(getSize().width,getSize().height);
                   offGraphics=offIm.getGraphics();
              if(!cards_loaded){
                   //display a message saying we're loading the cards...
                   offGraphics.setFont(new Font("Arial",Font.PLAIN,14));
                   offGraphics.setColor(new Color(171,205,239));
                   offGraphics.fillRect(0,0,getSize().width,getSize().height);
                   offGraphics.setColor(Color.black);
                   offGraphics.drawString("Loading cards... ",5,20);
                   offGraphics.drawRect(15,40, 102 ,10);
                   offGraphics.drawRect(13,38, 106 ,14);
                   offGraphics.setColor(new Color(171,205,239));
                   offGraphics.fillRect(0,0,150,35);
                   offGraphics.setColor(Color.black);
                   offGraphics.fillRect(15,40, (current_card_loading)*2 ,10);
                   offGraphics.drawString("Loading card: "+current_card_loading+1,15,20);
              }else{
                   Image currentCard;
                   while(card_width == -1)
                        card_width = deck.getCard(0).getImage().getWidth(this);
                   if(card_padding == -1)
                        card_padding = (width - (card_width * 2) - 4) / 4;
                   //clear the background...
                   offGraphics.setColor(Color.blue);
                   offGraphics.fillRect(0,0,width,height);
                   offGraphics.setColor(Color.black);
                   offGraphics.fillRect(1,1,width-2,height-2);
                   offGraphics.setColor(Color.white);
                   offGraphics.drawString("PLAYER:",card_padding,40);
                   offGraphics.drawString("DEALER:",(width/2) + card_padding,40);
                   offGraphics.drawString(message,5,height - 20);
                   if(games > 0)
                        offGraphics.drawString(games + " game(s) played...",5,height - 10);
                   //Draw the players hand...
                   for(int i=0;i<player_hand.getCardCount();i++){
                        currentCard = player_hand.getCards().getImage();
                        offGraphics.drawImage(currentCard, card_padding, 70+(20*(i-1)), this);
                   //now draw the dealers hand...
                   for(int i=0;i<dealer_hand.getCardCount();i++){
                        currentCard = dealer_hand.getCards()[i].getImage();
                        offGraphics.drawImage(currentCard, (width/2 ) + card_padding, 70+(20*(i-1)), this);
              //draw buffered image.
              g.drawImage(offIm,0,0,this);
    public void run(){
              MediaTracker t=new MediaTracker(this);
              System.out.println("Applet getting cards...");
              for(current_card_loading=0; current_card_loading < 52; current_card_loading++){
              //try{
                   card_images[current_card_loading] = getImage(getCodeBase(),
                                                                "cards/" + (current_card_loading+1) + ".gif");
                   if(card_images[current_card_loading] == null){
                        System.out.println("Null card... ["+current_card_loading+"]");
                   }else{
                        t.addImage(card_images[current_card_loading],0);
                   try{
                        t.waitForID(0);
                   }catch(InterruptedException e){
                        System.err.println("Interrupted waiting for images..>");
                   //lets show our new status.
                   repaint();
              //create the deck object now
              deck = new Deck(this,card_images);     //Create a new deck object.
              card_width = deck.getCard(0).getImage().getWidth(this);
              bHit.addActionListener(this);
              bStay.addActionListener(this);
              bRestart.addActionListener(this);
              bHit.setEnabled(false);
              bStay.setEnabled(false);
              width = getSize().width;
              height = getSize().height;
              this.add(bHit);
              this.add(bStay);
              this.add(bRestart);
              player_hand = new Hand();     //Create the hands...
              dealer_hand = new Hand();
              //make sure that the buttons appear properly.
              this.validate();
              message = "";
              cards_loaded = true;
              System.out.println("End of thread...");
              repaint();
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.io.*;
    class Deck {
         Card[] cards = new Card[52];
         int currCard;
         public Deck(Blackjack myApplet,Image[] card_images) {
              // These are the (initial) values of all the cards
              int[] values = {11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10};
              // Make all the cards, getting the images individually
              for (int i=0; i<52; i++) {
    //               Image image = myApplet.getImage(myApplet.getCodeBase(), "cards/" + (i+1) + ".gif");
                   cards[i] = new Card(card_images, values[i]);
              // Shuffle the cards.
              shuffleCards();
         public void shuffleCards(){
              Card temp;
              //loop through each card in the deck and swap it with some random card.
              for (int i=0; i<52; i++) {
                   int rand = (int)(Math.random()*52);
                   temp = cards[51-i];//take the current card...
                   cards[51-i] = cards[rand];//and swap it with some random card...
                   cards[rand] = temp;
              //now, reset the currentCard to deal...
              currCard = 0;
         public Card dealCard() {
              Card card = cards[currCard];
              currCard++;
              return card;
         public Card getCard(int i) {
              return cards[i];

    thanks for the advice.
    i've done what you suggested. but when i went try to compile the 2 programs i get error messages (shown below along with the modified code). do you know what are causing these error messages?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class Blackjack extends JFrame implements ActionListener,MouseListener{
         private Deck deck;     //The deck...
         private Hand player_hand;//player hand
         private Hand dealer_hand;//dealer hand.
         //private Button bHit=new Button("Hit");
         JButton bHit=new JButton("Hit");
         //private Button bStay=new Button("Stay");
         JButton bStay=new JButton("Stay");
         //private Button bRestart=new Button("New Game");
         JButton bRestart=new JButton("New Game");
         //lets do some double buffering.
         Image offIm=null;
         Graphics offGraphics=null;
         Dimension offDimension=null;
         Image[] card_images = new Image[52];
         private boolean cards_loaded = false;
         private int current_card_loading = 0;
         String message;                         //print a message...
         int width;          //The width of the applet
         int height;          //The height of the applet
         int card_width = -1;
         int card_padding = -1;     //How much should we pad the cards by..?
         private int games=-1;     //How many games have been played?
         public static void main(String[] args){
               Blackjack bj =new Blackjack(); 
              bj.pack();
              bj.setVisible(true);
         public Blackjack(){
            Thread card_loader = new Thread(this);
              card_loader.start();
              bHit.addMouseListener(this);
          bHit.addActionListener(this);
          //bHit.addMouseMotionListener(this);
              add(bHit);
              bStay.addMouseListener(this);
          bStay.addActionListener(this);
          //bStay.addMouseMotionListener(this);
              add(bStay);
              bRestart.addMouseListener(this);
          bRestart.addActionListener(this);
          //bRestart.addMouseMotionListener(this);
              add(bRestart);
              JFrame frame=new JFrame("BlackJack");
              frame.setSize(400,200);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(this);
            frame.pack();
            frame.setVisible(true);
         public void newGame(){
              bHit.setEnabled(true);
              bStay.setEnabled(false);
              player_hand = new Hand();     //Create new hands...
              dealer_hand = new Hand();
              //shuffle the deck.
              deck.shuffleCards();
              games++;
         public void hit(){
              bStay.setEnabled(true);
              player_hand.addCard(deck.dealCard());
              if(player_hand.getValue() > 21){
                   message = "You loose! (score:"+player_hand.getValue()+")";
                   //disable the hit and stay buttons...
                   bHit.setEnabled(false);
                   bStay.setEnabled(false);
                   return;
              message = "Score: "+player_hand.getValue();     
         public void stay(){
              while(dealer_hand.getValue() < 17){
                   dealer_hand.addCard(deck.dealCard());
              if(dealer_hand.getValue() <= 21 && player_hand.getValue() < dealer_hand.getValue()){
                   message = "You loose! (" + player_hand.getValue()+" - "+dealer_hand.getValue()+")";
              else if (player_hand.getValue() == dealer_hand.getValue()){
                   message = "You draw! (" + player_hand.getValue()+")";
              else{
                   message = "You win! (" + player_hand.getValue()+" - "+dealer_hand.getValue()+")";
              bHit.setEnabled(false);
              bStay.setEnabled(false);
         public void actionPerformed(ActionEvent e){
              if(e.getSource() == bRestart){
                   newGame();
              else if (e.getSource() == bHit){
                   hit();
              else if (e.getSource() == bStay){
                   stay();
              repaint();
         public void paint(Graphics g){
              update(g);
         public void update(Graphics g){
              //lets sord out double buffering
              if(offGraphics==null){
                   offIm=createImage(getSize().width,getSize().height);
                   offGraphics=offIm.getGraphics();
              if(!cards_loaded){
                   //display a message saying we're loading the cards...
                   offGraphics.setFont(new Font("Arial",Font.PLAIN,14));
                   offGraphics.setColor(new Color(171,205,239));
                   offGraphics.fillRect(0,0,getSize().width,getSize().height);
                   offGraphics.setColor(Color.black);
                   offGraphics.drawString("Loading cards... ",5,20);
                   offGraphics.drawRect(15,40, 102 ,10);
                   offGraphics.drawRect(13,38, 106 ,14);
                   offGraphics.setColor(new Color(171,205,239));
                   offGraphics.fillRect(0,0,150,35);
                   offGraphics.setColor(Color.black);
                   offGraphics.fillRect(15,40, (current_card_loading)*2 ,10);
                   offGraphics.drawString("Loading card: "+current_card_loading+1,15,20);
              else{
                   Image currentCard;
                   while(card_width == -1){
                        card_width = deck.getCard(0).getImage().getWidth(this);
                   if(card_padding == -1){
                        card_padding = (width - (card_width * 2) - 4) / 4;
                   //clear the background...
                   offGraphics.setColor(Color.blue);
                   offGraphics.fillRect(0,0,width,height);
                   offGraphics.setColor(Color.black);
                   offGraphics.fillRect(1,1,width-2,height-2);
                   offGraphics.setColor(Color.white);
                   offGraphics.drawString("PLAYER:",card_padding,40);
                   offGraphics.drawString("DEALER:",(width/2) + card_padding,40);
                   offGraphics.drawString(message,5,height - 20);
                   if(games > 0){
                        offGraphics.drawString(games + " game(s) played...",5,height - 10);
                   //Draw the players hand...
                   for(int i=0;i<player_hand.getCardCount();i++){
                        currentCard = player_hand.getCards().getImage();
                        offGraphics.drawImage(currentCard, card_padding, 70+(20*(i-1)), this);
                   //now draw the dealers hand...
                   for(int i=0;i<dealer_hand.getCardCount();i++){
                        currentCard = dealer_hand.getCards()[i].getImage();
                        offGraphics.drawImage(currentCard, (width/2 ) + card_padding, 70+(20*(i-1)), this);
              //draw buffered image.
              g.drawImage(offIm,0,0,this);
    public void run(){
              MediaTracker t=new MediaTracker(this);
              System.out.println("Frame getting cards...");
              for(current_card_loading=0; current_card_loading < 52; current_card_loading++){
              //try{
                   card_images[current_card_loading] = getImage(getCodeBase(),"cards/" + (current_card_loading+1) + ".gif");
                   if(card_images[current_card_loading] == null){
                        System.out.println("Null card... ["+current_card_loading+"]");
                   else{
                        t.addImage(card_images[current_card_loading],0);
                   try{
                        t.waitForID(0);
                   catch(InterruptedException e){
                        System.err.println("Interrupted waiting for images..>");
                   //lets show our new status.
                   repaint();
              //create the deck object now
              deck = new Deck(this,card_images);     //Create a new deck object.
              card_width = deck.getCard(0).getImage().getWidth(this);
              bHit.addActionListener(this);
              bStay.addActionListener(this);
              bRestart.addActionListener(this);
              bHit.setEnabled(false);
              bStay.setEnabled(false);
              width = getSize().width;
              height = getSize().height;
              this.add(bHit);
              this.add(bStay);
              this.add(bRestart);
              player_hand = new Hand();     //Create the hands...
              dealer_hand = new Hand();
              //make sure that the buttons appear properly.
              this.validate();
              message = "";
              cards_loaded = true;
              System.out.println("End of thread...");
              repaint();
    ----jGRASP exec: javac -g X:\NETPROG\Assignment2\Blackjack.java
    Blackjack.java:7: Blackjack is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
    public class Blackjack extends JFrame /*Applet*/ implements ActionListener,MouseListener/*,Runnable*/{
    ^
    Blackjack.java:53: cannot find symbol
    symbol : constructor Thread(Blackjack)
    location: class java.lang.Thread
         Thread card_loader = new Thread(this);
    ^
    Blackjack.java:209: cannot find symbol
    symbol : method getCodeBase()
    location: class Blackjack
                   card_images[current_card_loading] = getImage(getCodeBase(),"cards/" + (current_card_loading+1) + ".gif");
    ^
    3 errors
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.
    import java.awt.*;
    import javax.swing.JFrame;
    import java.net.*;
    import java.io.*;
    class Deck {
         Card[] cards = new Card[52];
         int currCard;
         public Deck(/*Blackjack myApplet*/Blackjack myFrame,Image[] card_images) {
              // These are the (initial) values of all the cards
              int[] values = {11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
                   11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10};
              // Make all the cards, getting the images individually
              for (int i=0; i<52; i++) {
                   cards[i] = new Card(card_images, values[i]);
              // Shuffle the cards.
              shuffleCards();
         public void shuffleCards(){
              Card temp;
              //loop through each card in the deck and swap it with some random card.
              for (int i=0; i<52; i++) {
                   int rand = (int)(Math.random()*52);
                   temp = cards[51-i];//take the current card...
                   cards[51-i] = cards[rand];//and swap it with some random card...
                   cards[rand] = temp;
              //now, reset the currentCard to deal...
              currCard = 0;
         public Card dealCard() {
              Card card = cards[currCard];
              currCard++;
              return card;
         public Card getCard(int i) {
              return cards[i];
    ----jGRASP exec: javac -g X:\NETPROG\Assignment2\Deck.java
    Blackjack.java:6: Blackjack is not abstract and does not override abstract method mouseExited(java.awt.event.MouseEvent) in java.awt.event.MouseListener
    public class Blackjack extends JFrame implements ActionListener,MouseListener{
    ^
    Blackjack.java:45: cannot find symbol
    symbol : constructor Thread(Blackjack)
    location: class java.lang.Thread
         Thread card_loader = new Thread(this);
    ^
    Blackjack.java:201: cannot find symbol
    symbol : method getCodeBase()
    location: class Blackjack
                   card_images[current_card_loading] = getImage(getCodeBase(),"cards/" + (current_card_loading+1) + ".gif");
    ^
    3 errors
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  • How to handle events in Swng

    Hi!
    I would like to know which one of the following is the best way to handle events in Swing application.
    Method 1
    Write annonymus inner classes in the same class
    Method 2
    =======
    Write a seperate class which extends the adapter class of the event handling and create an object of that in the main class and assign it to the components with addActionHandler() method.
    I am trying to use the second one and I have the following design issue.
    I have a class frmMain.java in which I have a frame and to that frame I am adding a panel which consists of 'N' No. of components.
    I want to make this panel added to the frame when I click on a menu item (login) and want to remove the panel from frame when I click on a menu item(logout).
    I have a main class called Application.java where I create the object of my frame(frmMain.java).
    Thanks in advance,
    AV

    1. Your JFrame is now subject to receive action events from anywhere. You will have to be more careful that you respond only to the right events.
    2. If you have a lot of possible consequences to an event(for example, based on button pressed), you'll need a long if...then...else statement to determine what to do based on the source of the event.
    3. With individual ActionListener classes, it's easier to add the same listener to multiple components and no need to worry about source.
    4. Kind of the same thing: With individual classes, the event and its consequences are so tightly coupled.
    End preaching....basically, my style boils down to what I call the tool set vs Swiss army knife rule. Java seems designed around the concept of a large number of specific purpose classes vs a smaller number of multi purpose classes and I think its a design methodology that makes sense, because I believe strongly in functional isolation in my code.

  • How to Add AWT Frame to JMenubar....

    I was using AWT Frame for my project ... Now I want to add Menubar ... I was added AWT Menubar ... but its not looking fine .... So i want to add JMenubar ....
    What i will do....
    Thnaks in Advance...

    if you must
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      public void buildGUI()
        javax.swing.JMenuItem open = new javax.swing.JMenuItem("Open");
        javax.swing.JMenuItem exit = new javax.swing.JMenuItem("Exit");
        javax.swing.JMenu menu = new javax.swing.JMenu("File");
        menu.add(open);
        menu.add(exit);
        javax.swing.JMenuBar menuBar = new javax.swing.JMenuBar();
        menuBar.add(menu);
        Frame f = new Frame();
        f.add(menuBar,BorderLayout.PAGE_START);
        f.setSize(200,100);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
        f.addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent we){
            System.exit(0);
      public static void main(String[] args)
        EventQueue.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How to prevent the automatic full-white repainting of an AWT Frame?

    Using Java 1.6.0, Windows XP, 1.6.0-b105 Client VM I have the following problem:
    I made a double buffered AWT frame. But it still flashes sometimes. It gives one flash about 6 seconds after start of application. There seems to be an incoming event "for no discernible reason". I have overridden all paint/repaint/update methods in my Frame sub class.
    These unwanted flashes are caused by the AWT painting the frame in white and then calling paint.
    I may have caught these weird calls:
    The good/normal case looks like:
    java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Thread.java:1206)
    at xed.xed_Frame.paint(xed_Frame.java:125)
    at xed.xed_Frame.update(xed_Frame.java:119)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
    at sun.awt.RepaintArea.paint(RepaintArea.java:216)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)
    at java.awt.Component.dispatchEventImpl(Component.java:4486)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Window.dispatchEventImpl(Window.java:2429)
    at java.awt.Component.dispatchEvent(Component.java:4240)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    The differences in the bad case: (Not all traces of this kind cause the flashing. But after all flashes there seems to be such a trace.)
    at xed.xed_Frame.paint(xed_Frame.java:125)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
    at sun.awt.RepaintArea.paint(RepaintArea.java:224)
    at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)
    So how do I stop these unwanted white redraws of the Frame?

    Accidentally found the answer:
    System.setProperty("sun.awt.noerasebackground", "true");

  • How to open page in new window while handling event on link.

    Hi all
    I have a requirement where page should be opened in new window when I click on link.My item style is 'link'.Despite of mentioning target frame _blank, I m not able to open it in new window.I m handling event by setting Action Type as fireAction.I hope this might be the reason because of that this happened. Can somebody suggest some solution so that I can open it in new window.
    Thanks,
    Bhupendra

    Hi ,
    though i am not able to answer, i can get some answer for my question.
    How the link item is handled thru the ActionType and event in the Client Action..?
    The reason for this question is that we are trying to extend the customer search page in AR - EBSR12. there the search result page has the Account Name as a link and the Action event says viewAccountName and the action type says firePartialAction. I am trying to understand this so that i can add more parameters to the link so that i can use them in the target page of the link..
    Any help is appreciated..
    Thanks
    Chidam

  • Handling events in ALV grid

    hi,
    Hi,
    I am displaying some fields from VBAP in ALV gid and have give drop down check box to storage location making it editable  so  if the user changes Storage location  of
    some entries and clicks SAVE button, when we click save button i need to capture all the rows that were been changed and update VA02 using these records through bapi.
    but iam not able to capture this SAVE event but iam able to capture Enter and cursor event.
    i have written following code for this
    LOCAL CLASSES: Definition
    class lcl_event_receiver: local class to handle event CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_data_changed
             FOR EVENT data_changed OF cl_gui_alv_grid
                 IMPORTING er_data_changed.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    LOCAL CLASSES: Implementation
    class lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
        METHOD handle_data_changed.
        DATA: l_error_in_data TYPE c.
        PERFORM handle_data_changed USING er_data_changed l_error_in_data.
    *§7.Display application log if an error has occured.
        IF l_error_in_data EQ 'X'.
          CALL METHOD er_data_changed->display_protocol.
        ENDIF.
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *&      Form  handle_data_changed
         Identify columns which were changed and check input
         -->P_ER_DATA_CHANGED  text
    FORM handle_data_changed  USING  p_er_data_changed
                              TYPE REF TO cl_alv_changed_data_protocol
                              p_error_in_data TYPE c.
      DATA : lw_mod_cell TYPE lvc_s_modi ,
             l_value TYPE lvc_value ,
             l_lgort TYPE lgort_d.
      SORT p_er_data_changed->mt_mod_cells BY row_id .
      LOOP AT p_er_data_changed->mt_mod_cells INTO lw_mod_cell
                              WHERE fieldname = 'LGORT'.
        CALL METHOD p_er_data_changed->get_cell_value
          EXPORTING
            i_row_id    = lw_mod_cell-row_id
            i_fieldname = 'LGORT'
          IMPORTING
            e_value     = l_value.
        SELECT SINGLE lgort FROM t001l INTO l_lgort WHERE werks = p_werks
                                                    AND   lgort = l_value.
        IF sy-subrc NE 0.
    In case of error, create a protocol entry in the *application log.
          CALL METHOD p_er_data_changed->add_protocol_entry
            EXPORTING
              i_msgid     = '0K'
              i_msgno     = '000'
              i_msgty     = 'E'
              i_msgv1     = text-003
              i_msgv2     = l_value
              i_msgv3     = text-004
              i_fieldname = lw_mod_cell-fieldname
              i_row_id    = lw_mod_cell-row_id.
          p_error_in_data  = 'X'.
          EXIT.
        ELSE.
    *§5b.If the value is valid change values of
       cells.
          CALL METHOD p_er_data_changed->modify_cell
            EXPORTING
              i_row_id    = lw_mod_cell-row_id
              i_fieldname = lw_mod_cell-fieldname
              i_value     = l_value.
          READ TABLE t_list1 INTO w_list1 INDEX lw_mod_cell-row_id.
          IF sy-subrc EQ 0.
    *comparing old value with the changed value
            IF w_list1-lgort <> l_value.
              MOVE:      w_list1-werks  TO w_list3-werks,
                         w_list1-matnr  TO w_list3-matnr,
                         w_list1-arktx  TO w_list3-arktx,
                         w_list1-vbeln  TO w_list3-vbeln,
                         w_list1-posnr  TO w_list3-posnr,
                         w_list1-pstyv  TO w_list3-pstyv,
                         w_list1-vstel  TO w_list3-vstel,
                         w_list1-auart  TO w_list3-auart,
                         w_list1-kwmeng TO w_list3-kwmeng,
                         w_list1-vrkme  TO w_list3-vrkme,
                         w_list1-mbdat  TO w_list3-mbdat,
                         l_value        TO w_list3-lgort.
              APPEND w_list3 TO t_list3.
    *t_list3 will contain all the records that are changed
              CLEAR w_list3.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF go_custom_container IS INITIAL.
    create a custom container control for our ALV Control
        CREATE OBJECT go_custom_container
          EXPORTING
            container_name              = g_cont_on_main
                EXCEPTIONS
                    cntl_error = 1
                    cntl_system_error = 2
                    create_error = 3
                    lifetime_error = 4
                    lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    Display error message.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = sy-repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'.
        ENDIF.
    create an instance of alv control
        CREATE OBJECT go_grid
          EXPORTING
            i_parent          = go_custom_container.
    *If display or change radio button is cheked
        IF ( p_chng = 'X' OR p_disp = 'X' ) .
    Set a titlebar for the grid control
          g_layout-grid_title = 'Sales Orders'.
          g_layout-excp_fname = 'TRAFFIC_LIGHT'.
    Define a drop down table.
          PERFORM set_drdn_table.
          CALL METHOD go_grid->set_table_for_first_display
            EXPORTING
              is_layout                     = g_layout
            CHANGING
              it_outtab                     = t_list1
              it_fieldcatalog               = t_fieldcat1
            EXCEPTIONS
              invalid_parameter_combination = 1
              program_error                 = 2
              too_many_lines                = 3
              OTHERS                        = 4.
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
    register ENTER and CURSOR to raise event DATA_CHANGED.
      (Per default the user may check data by using the check icon).
        CALL METHOD go_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD go_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
        CREATE OBJECT g_event_receiver.
        SET HANDLER g_event_receiver->handle_double_click  FOR go_grid.
        SET HANDLER g_event_receiver->handle_hotspot_click FOR  go_grid .
        SET HANDLER g_event_receiver->handle_data_changed  FOR  go_grid .
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = go_grid.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      ok_code = sy-ucomm.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN 'SAVE'.
          PERFORM update_sales_order using t_list3[].
    endcase.
    Thanks in Advance,
    Siri

    Hi Sirisha,
              You can get the event code for Enter because you have regitered in the event reciever .
    But for the SAVE you will have to set in the PF-status of the screen and not the ALV-grid save .
    Please award if helpful.

  • Photos are being added to my iPad, without choosing any events in iPhoto or having them sync with iCloud

    Photos are being added to my iPad, without choosing any events in iPhoto or having them sync with iCloud
    I just upgraded to IOS6, and now my ipad is full of pictures I did not choose to sync.
    I cannot delete them without deleting them from all sources.
    Actually, the message is when I go to hit EDIT, select a picture, and then choose DELETE: "This photo is used in an album. Do you want to delete it everywhere? Delete Everywhere"
    Does that mean "Everywhere" on my iPad, or everywhere including whatever place on my computer it found the photos to begin with?
    PLEASE HELP
    Ps:
    I've already done this:
    To delete photos from your device
    In iTunes, select the device icon in the Devices list on the left. Click the Photos tab in the resulting window.
    Choose "Sync photos from."
    On a Mac, choose iPhoto or Aperture from the pop-up menu.
    On a Windows PC, choose Photoshop Album or Photoshop Elements from the pop-up menu.
    Choose "Selected albums" and deselect the albums or collections you want to delete.
    Click Apply.

    You can still sync the photos and keep the photos that are already on the device. You have to include all of the albums or events in the pictures folder that you sync from. If you are using iPhoto, select that in the Sync Photos from drop down menu and then select all of the albums or events that you want to sync. Make sure to check Selected Albums, events, faces and automatically include (no events). Using that option will allow you to choose exactly which albums and events to sync.
    You have to remember that all photos must be included in every sync so you cannot sync photos from iPhoto today and then try to sync photos from another folder tomorrow, or you will erase all of the photos that were synced from iPhoto. You need to maintain one main Photos syncing folder for the photos that you want to transfer to the iPad. You can have subfolders within that one main folder and you can selectively sync those subfolders. You just have to place all of the photos that you want to sync into one main iPad syncing photos folder.
    There are WiFi transfer apps that allow you to transfer photos to the iPad without having to sync with iTunes. I use this one. This app (and others like it) will allow you to use multiple computers to transfer photos.
    Wireless Transfer App Easily send photos to iPhone/iPad ...

  • Handling events in combo box

    Hello,
    I'm very much confused about the handling events of JComboBox with ActionListener and ItemListener. Both are seemed similar to me. If anyone can explain me the differences, it would be helpful for me. Thanks everybody.

    ActionEvents are fired each time any item is selected, ItemEvents are only fired, if the selection changes.

  • Handling events in BSP application using WML tag Extensions

    Hello Everyone  ,
                            We are developing a BSP applications for Mobile handheld using WML tag library. I am looking for some code samples to know how we can handle evevents inside the BSP using the WML tag library.
    Can any one of  you plesae help us by placing a code snippet for handling onInputprocessing() methods (BSP Using WML Tag extensions).
    I mean to ask how we can handle events inside the BSP applications that uses the WML tag library.
    I know about how to handle BSP events using HTMLB and XHTMLB tags frameworks.
    Thanks for your help in advance.
    Thanks,
    Greetson

    Is this WML tag library something that is supplied by SAP u2013 as a BSP Extension Element?  Or are you just using WML tags directly in your layout?  I can tell you in general that if you want to generate HTMLB events from regular HTML code you can generate the JavaScript calls using the htmlbEvent tag of the BSP extension library.  However your tags have to be running within an HTMLB Content tag for this to work.
    If you want to work totally without HTMLB then you need to use the simple HTTP Post but format the input name as OnInputProcessing(<function code>) like this:
    <input type="submit" name="OnInputProcessing(ok)" value="OK">
    This will cause the OnInputProcessing event handler to trigger without needing any HTMLB tags (this is how it was done in WebAS 6.10 before we BSP Extensions).

  • Handling Events in FXML-includes

    Hi!
    I am using FXML to define the GUI of my application. As the GUI is pretty complex with many regions and items in it, I have created a separate FXML file for each main region to reduce the overall complexity of maintaining the design.
    My parent FXML file, called "Frame.xml", includes those "sub-regional" FXML-definitions using "<fx:include source="RegionXYZ.fxml" />".
    What I am now stucked with is, how to handle events in this approach...
    Questions:
    a) Can I add a separate controller in each of the "sub-regional" FXML-files, like "fx:controller="FXMLRegionXYZController"?
    b) Or must I, or even should I, use only a single controller inside the main FXML? Will this single controller be able to recognize and handle actions/events in the included FXML-definitions as well?
    c) What is the best approach in general for this?
    Thanks,
    Jörn

    Hi!
    I am using FXML to define the GUI of my application. As the GUI is pretty complex with many regions and items in it, I have created a separate FXML file for each main region to reduce the overall complexity of maintaining the design.
    My parent FXML file, called "Frame.xml", includes those "sub-regional" FXML-definitions using "<fx:include source="RegionXYZ.fxml" />".
    What I am now stucked with is, how to handle events in this approach...
    Questions:
    a) Can I add a separate controller in each of the "sub-regional" FXML-files, like "fx:controller="FXMLRegionXYZController"?
    - Yes, you can
    b) Or must I, or even should I, use only a single controller inside the main FXML? Will this single controller be able to recognize and handle actions/events in the included FXML-definitions as well?
    - if you could control everything from a single controller but you option (A) is much better
    c) What is the best approach in general for this?
    - Option (a)
    Thanks,
    Jörn

Maybe you are looking for

  • After installing 4 add ons and restarting, firefox no longer works - help!

    On my PC running Windows 7, I installed these 4 add ons: Measure it, Web Developer, Colorzilla, and Screenshot, restarting Firefox, and only the home page came up, none of my bookmarks were working. I had to manually type in a web address for anythin

  • Best approach

    Hi Gurus, I need to create an extractor to have all the information of FAGLFLEXT, because we need to keep the ledger information and the split of the information.  However, we need to add 13 fields contained in BSEG.  Therefore we thought to reads th

  • Streaming large text/html data to browser using JSP.

    Current Implementation of my code using JRUN: JSP program on request from browser does the following:      i)calls legacy system function that writes output to socket      ii) calls a java bean function which           1) collect data from socket and

  • HT6114 i wantthis for my loptop macbook please give me a chance to download for free

    please give me free download of OS XMAVERICKS for my macbook loptop

  • Error:"Servlet action is currently unavailable"

    Hi, I wrote a servlet program, when I run in URL "http://localhost:8080/Tomcat1/" its working fine. But "http://localhost:8080/Tomcat1/first.do" its throwing an error message Servlet action is currently unavailable description The requested service (