Problem in displaying Icon on JButton

Hi,
I have a problem ..
In my program I have to set Icon for a Jbutton and wait for 2 secs and then remove the Icon..
I used jb.setIcon(Imageicon) (jb is button reference) to set the icon and jb.setIcon(null) to remove Icon
Now no Icon is displayed on the button at all....
My code looks like below mentioned
jb.setIcon(Imageicon)
Thread.sleep(2000);
jb.setIcon(null)
plz reply mee at the earliest...

the code snipped is like this..
the below mentioned code is in actionPerformed method
pres.setIcon(iial.get(Integer.parseInt(pres.getName())));  //icon for prev is already set
          System.out.println("Icon for pres is set now");
// need to wait for 2 seconds before both the icons are set to null
          prev.setIcon(null);
          pres.setIcon(null);Here prev and pres are references to JButtons.
I tried the swing timers but couldnt succeed (i might be implemented them in an incorrect way coz im not familiar with them)
plz cud you provide me with am example program or a solution to above scenario in a program.....
Here is the actual program if you want you can run it with keeping atleast 9 images in tn folder and changing maxpics value to 9
Game.java
package com;
//Concentration Game
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class Game extends JFrame implements ActionListener {
     private static final long serialVersionUID = 1L;
     public static void main(String args[]) throws InterruptedException,
               InvocationTargetException {
System.out.println();
SwingUtilities.invokeLater(new Runnable() {
    public void run() {
         Game cg = new Game();
          cg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     Logic logic;
     private int[][] arr;
     private Container contents;
     private JLabel controlLabel;
     private JPanel controlPanel;
     private JButton[][] gameBoardLabel;
     private JPanel gamePanel;
     private ArrayList<ImageIcon> iial;
     private boolean isNewAction = true, isFirstAction = true;
     private JButton prev, pres;
     private long s_time, e_time, t_time;
     private int SIZE, arrvalue, maxpics = 51, pairscount, no_of_pairs;
     public Game() {
          super("Concentration Game");
          logic = new Logic();
          logic.populateArray();
          logic.shuffle();
          logic.printArray();
          arr = logic.getArray();
          SIZE = logic.getSize();
          no_of_pairs = (SIZE * SIZE) / 2;
          iial = new ArrayList<ImageIcon>();
          for (int i = 1; i <= maxpics; i++) {
               iial.add(new ImageIcon(this.getClass().getClassLoader()
                         .getResource("tn/image" + i + ".jpg")));
          Collections.shuffle(iial);
          System.out.println("Completed loading images");
          contents = getContentPane();
          contents.setLayout(new BorderLayout());
          gameBoardLabel = new JButton[SIZE][SIZE];
          new JPanel();
          gamePanel = new JPanel();
          controlPanel = new JPanel();
          gamePanel.setLayout(new GridLayout(SIZE, SIZE, 5, 5));
          controlLabel = new JLabel("Game not started");
          for (int r = 0; r < gameBoardLabel.length; r++) {
               for (int c = 0; c < gameBoardLabel[r].length; c++) {
                    arrvalue = arr[r][c];
                    System.out.println(arrvalue);
                    if (arr[r][c] == 0) {
                         gameBoardLabel[r][c] = new JButton();
                         gameBoardLabel[r][c].setEnabled(false);
                    else
                         gameBoardLabel[r][c] = new JButton();
                    gameBoardLabel[r][c].addActionListener(this);
                    gameBoardLabel[r][c].setName("" + arrvalue);
                    gameBoardLabel[r][c].setPressedIcon(iial.get(arrvalue));
                    gamePanel.add(gameBoardLabel[r][c]);
          controlPanel.add(controlLabel);
          contents.add(gamePanel, BorderLayout.CENTER);
          contents.add(controlPanel, BorderLayout.SOUTH);
          setSize(400, 500);
          setVisible(true);
          System.out.println(this);
     @Override
     public void actionPerformed(ActionEvent e) {
          JButton jb = (JButton) e.getSource();
          // System.out.println(jb.getName());
          System.out.println(e.getSource());
          if (isFirstAction) {
               controlLabel.setText("Game Started");
               s_time = System.currentTimeMillis();
               isFirstAction = false;
               System.out.println(this);
          if (isNewAction) {
               prev = pres = jb;
               jb.setIcon(iial.get(Integer.parseInt(jb.getName())));
               isNewAction = false;
               return;
          prev = pres;
          pres = jb;
          if (pres == prev)
               return;
          if (pres.getName().equals(prev.getName())) {
               pres.setIcon(iial.get(Integer.parseInt(pres.getName())));
               pres.removeActionListener(this);
               prev.removeActionListener(this);
               controlLabel.setText("pair matched");
               resetAttributes();
               System.out.println("haha----last count==" + ++pairscount);
               if (pairscount == no_of_pairs) {
                    e_time = System.currentTimeMillis();
                    t_time = (e_time - s_time) / 1000;
                    controlLabel.setText("Game Over in " + t_time + " secs");
                    System.out.println("done");
          System.out.println(pres);
          pres.setIcon(iial.get(Integer.parseInt(pres.getName())));
          controlLabel.setText("pair didn't match");
          System.out.println("pres is set now");
          prev.setIcon(null);
          pres.setIcon(null);
          resetAttributes();
     private void resetAttributes() {
          prev = pres = null;
          isNewAction = true;
Logic.java
package com;
import java.util.ArrayList;
import java.util.Collections;
import javax.swing.JOptionPane;
public class Logic{
      ArrayList<Integer> al;
      int arr[][],arrlist[][],elements=1;
      int SIZE;
int[][] getArray()
          return arrlist;
int getSize(){
     return SIZE;
public static void main(String args[]){
     Logic logic =new Logic();
            logic.populateArray();
           logic.shuffle();
           logic.printArray();
           //System.out.println(logic.elements);
void populateArray(){
     String input=JOptionPane.showInputDialog(null,"Enter Size of the array (less than 11)" );
     SIZE=Integer.parseInt(input);
     int cnt = 0;
     arrlist=new int[SIZE][SIZE];
     al=new ArrayList<Integer>();
     for (int r = 0; r < SIZE; r++)
          for (int c = 0; c < SIZE; c++)
               al.add(elements);
               cnt++;
               if (cnt == 2)
                    cnt = 0;
                    elements++;
public  void printArray() {
     for (int i = 0; i < SIZE; i++)
      for (int j = 0; j < SIZE; j++)
        arrlist[i][j] = al.get(j + i * SIZE);
        System.out.print(" "+arrlist[i][j]);
      System.out.println();
public  void shuffle() {
          Collections.shuffle(al);
     if(SIZE%2!=0)
          int cindex=(SIZE*SIZE)/2; //center index
          int celement=al.get(cindex); //center element
          int lindex=al.indexOf(elements); //index of large element
          //al.remove(cindex);
          //al.add(cindex, 0);
          al.remove(lindex);
          al.add(lindex, celement);
          al.remove(cindex);
          al.add(cindex, 0);
}

Similar Messages

  • Authorization problem when displaying icons in BW Report

    Hi All
    I have the following problem when display BW Report as iView: The report data itself is displayed perfectly but to display the icons (like DrillDown arrows, Hierarhy level open arrows) the Windows login message "Connect to <my BW server.com>:8000" appears and I have to enter BW user name and password explicitly. The system for BW is defined, the user is mapped, UIDPW method is used. Again, the report data itself is displayed, the problem is only with icons. I can see that the path to icons is like:
    http://<my BW server>.com:8000/sap/bw/Mime/BEx/Icons/s_b_up.gif
    How could I rid of this authorization request?

    Thanks! I already did this and it helped for most of icons. But for five remaining icons i still get authorization request althoug these icons are in the same path. The icons are:
    http://<server>.com/sap/bw/Mime/BEx/Icons/cascading.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/checked.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/separator.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/marked_right_35.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/loading.gif

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • Itunes on Windows 7 only displaying icons and pics? Text has disappeared?

    Itunes on Windows 7 only displaying icons and pics? Text has disappeared? Library content is still there but all text details now missing

    Same problem here!  Driving me nuts that it is somehow "running" as shown in the task bar, but it is not accessible in any way.

  • Problem in displaying images one by one in JList

    I have a problem in displaying images one by one in Jlist. I want to show 100 images as a thumbnailview in jlist but it is talking too much time to show all the images after scalling 100 images to thumbnail view and making it into ImageIcon. So, i thought that it would be better way to show one by one after scaling it into thumnailview. But my renderer is getting calling after 100 images scaled down and setting into list. I have posted my code 2 days back but there is no reply.
    http://forum.java.sun.com/thread.jspa?threadID=789943
    I donno where i am missing in this code.
    Plz suggest me some solution for it.

    Where is the scaling done? In the ListCellRenderer? Regardless of where that is being done, I assume you are caching the scaled images after you scale them, right? If not, consider adding some sort of caching.
    This should do the trick...
    Rework your ListCellRenderer to check to see if a scaled version of the image is available. If not, start a thread to do the scaling and create an ImageIcon. In the meantime, while that thread is running, have the renderer return some sort of stock icon, like a little generic image icon. When the scaling thread completes, make a call to repaint() on the JList so the cell renderer gets re-asked for the icons. This time around, the renderer should notice that a scaled version (the ImageIcon) is available. Return that. So, this method doesn't guarantee that the images will be produced in order, 1...2...3..., but it will return images as they become available, and the overall JList rendering won't wait until all 100 are ready. If you want them returned in order, just do all of the scaling in a single thread and queue up the images to be scaled, in order.
    I hoped this helps. (If it does, please throw me some Duke Dollars.)

  • Menu bar display icon disappears after resize

    My menubar display icon goes away after resize and the checkbox for it in system preferences unchecks itself. Has anyone else experienced this bug? Closing system preferences between resizes doesn't fix. Restarting machine doesn't fix. (Of course with my new macbook pro retina, I'm constantly resizing the display between resolutions that make my jaw drop to resolutions that I can read text on, so I need it in the menu bar.)

    Thanks for the link. Looks like it was a program I didn't even remember I installed, WiFind, which was causing the problem. I got rid of it and it looks like the menu bar icons are working again. Strange thing was when I tried to search for WiFind neither Spotlight nor the Find function in the finder could locate it. But there it was, right in the the Library/InputManagers folder. It's happened to me before I and don't know why. Anyway...
    I hope I don't have any more problems with this update but I've been burned by Leopard so many times I'm not counting on it! I'll try and stay positive.

  • Iconic buttons not display icons

    Hello All,
    i have problem with the iconic buttons not display icons in forms 10g
    i have set button properties as
    iconic=yes
    icon filename=print
    my path for icons and forms are
    e:\backoffice
    plz any solution
    thx
    najeeb ur rehman

    Hi,
    Read the doc at :
    http://www.oracle.com/technology/ products/forms/pdf/webicons.pdf
    It's very descriptive and It'll help you...
    Regards ,
    Simon

  • IChat wont display icons on new system

    I just got a new mac pro and am having trouble getting ichat to display icons for anyof my buddies. I only get the standard "aim running man for all of my buddies"
    I have tried suggestions in all other posts on this forum. I've opened all the necessary ports, cleared the icon caches, but still nothing works.
    My older system was a 12 inch powerbook and that displayed icons just fine.
    Any idea what the problem is?

    Hi Truz,
    iChat uses the TCP side of port 5190 to Log in to AIM and the UDP part of port5190 to get info back from a different AIM server.
    It is likely something around this area.
    Open iChat
    Go to Preferences > Accounts.
    Log out of AIM
    Open Server Settings tab
    Change the port to 443
    Log back into AIM.
    9:47 PM Friday; May 25, 2007

  • All displays/icons/everything just got bigger

    Hi
    I hope that is is a very easy problem to solve. All the displays icons and everything has just increased/ almost doubled in size on my imac. So nothing now appears to fit on the screen.
    How do I set everything back to the original size display. For example the information on the top tool bar now takes up the whole tool bar whereas before it only took up about one third of the tool bar.
    Also on firefox it used to display 14 sites on the top tool bar search it now only displays 7.
    Is there a way that I can reset the size of all displays back to the original factory based size setting?

    Thanks
    Went over again what you said and now everything is back to normal.
    Thanks
    James

  • Iphone 3GS displaying icons very largely.......

    I am facing a very strange problem, my iphone model 3GS is displaying icons on the screen very large in size, than the usal format.
    I tried to solve the problem by switching on/off, tried the settings options.
    But did not go for restoring the factory settings, because of the doubt i may lose all the contacts saved in the phone.
    Please advise any solution and clear the doubt of losing the saved contacts if i apply the factory resetting option.

    If you select erase all content and settings on your iPhone, this does exactly as provided - it will erase all content and settings - everything but the firmware/included software.
    If you restore your iPhone with iTunes as a new iPhone or not from your iPhone's backup, the same applies.
    Contacts are designed to be synced with a supported application on your computer. With Windoze, this can be with Outlook 2003 or 2007 along with syncing calendar events, or with Windows Contacts for syncing contacts only - the address book used by Windows Mail with Vista.
    If you aren't currently using a supported application on your computer for contacts - the address book is empty, before syncing contacts with the application enter one contact in the application on your computer. Make this contact up if needed, which can be deleted later. This will provide a merge prompt with the first sync for this data, which you want to select. Contacts between the two will be kept synchronized with following syncs. Syncing contacts with a supported application on your computer is selected under the Info tab for your iPhone sync preferences with iTunes. You can do this before restoring your iPhone with iTunes which will also give you access to your contacts on your computer.

  • Any defference  display icon between ecc and ecc6

    Hi,
    any defference  between ecc and ecc6  to display ICON
    my problem is i was run the one program in ecc  then output shows with icons.
    same program run in ecc6  output is same but ther is no icons like ecc
    Regards
    naresh

    Hi
    Good
    Yes you could find some new icons in between ECC and ECC 6.0 but I dont think there is lots of difference between these two, though you have not mentioned the program name it is hard to give you the correct reply on that, but yes in some standard program cases you may find this kind of problems.
    Thanks
    mrutyun^

  • HUGES problems with display after waking up from hibernate mode

    Hello everybody,
    I hope that somebody can help me soon, because in the last 15 days I'm reaaaaallly annoyed with MAC's issues.
    In the last 15 days it seemd I had to reboot it a lot of times, because it freezes, it crashes, etc...
    Neverthless what happened today it passes all the limits: in the last period, because of these often crashes, I turn the mac off at night, on the other hand when I go to work I simply close the display and let it hibernates.
    Today when I came back after work I opened it and it was amazing:
    it has a different desktop!! With different icons in the dock, diferent icons in the top-right part, and it was freezed! I had to force it to shut down, restart it...and since then, I had huge problem with display.
    It shakes everything while scrolling mails, web pages or icons in the dock. If I scroll between desktops, it takes year lights more than yesterday!!
    Nothing happen if I restart as many time as I want.
    In my simple opinion it seems a virus issue, but..as far as I know, there is no need to install an AV on a mac, right???
    I tried to record some of these probls with the QT, but when you start recording all the desktop, it seems A LITTLE better, smoothing all these shaking effects. NEverthless they are still noticeable.
    I'll try to attach a video as a dropbox link, 'cause I can't attach it on the message (it is denied)
    PLEASE HELP MEEEEE!!!!
    https://www.dropbox.com/s/r1mlpjo5x8g1tkj/scrolling%20problems.mov
    https://www.dropbox.com/s/g1ey1xrheo9mvti/scrolling%20problems2.mov
    https://www.dropbox.com/s/ljtm53go8ywt9fs/scrolling%20prob3.mov

    I am going to add my problem to this as I believe it fits and may add to the conversation.
    I have a MacBook Pro, am using Parallels, and have an issue waking it up from sleep.
    Circumstances:
    I close the lid and walk away from the device in my office. When I return, (over night or an hour later) I open the lid, and if nothing happens swipe the touchpad or press a key, the power light changes from pulsating to steady. then in less than 15 seconds it goes back to pusating. The display never energizes, only remain black.
    I usually try opening and closing several times, and occaisionally that will work. Other times, I hold the power key until I hear the drive halt, then turn it on. The grey screen will display, then blue, then just before it gets to the log in, the screen goes black (not energized) and the light pulsates.
    I have tried the PRAM reset and Safe Mode starts with no luck.
    *Now the really wierd thing.* I decieded to contact Apple support on line and pay for help (yes that is weird in an of itself for me). As I began the process it came to the part for me to enter my serial number. With the lid open, I turned the MacBook on its side to try to read the number and the screen energized and the password unlock prompt was waiting for me to enter the password.
    Observations
    I had read where the light sensor could be blocked by dirt or the light in the room was too dim, but I clean the screen and there is plenty of light. Dales Post is the first that I have seen Parallels and the Sudden Motion Sensor. That makes some sense to me because of what happened when I turned it on its side. I have verified that it happens regardless of using Parallels. as teh last time I did it I had closed out of all my VMs and I believe exited Parallels.
    I am going to try the deleting the power preferences file and will report back.

  • How do I add the Displays icon to the Menu Bar?

    In prior OS on my iMac, I was able to add the Display icon to the Menu Bar, making it a quick fix to adjust the resolution.  That option no longer appears in the Display section of System Preferences.  I am using multiple displays.  Could that make any difference?  Any suggestions?

    http://displaymenu.milchimgemuesefach.de/about.html

  • Problem in displaying the TaxRate columns .

    Hi Experts,
                            I am having a problem in displaying the 'TaxRate', in this Query there are some different Taxrate's columns  like-  ' 'Basic Excise Duty BED@10 %',  ' Education ces@2% ' , 'Secondary Education Cess @1%',    etc.   only  4 -5  tax's value should display  at a  time  and rest of  the TaxRate's  columns whose value is NULL  should not display.
    So, I want to display only those TaxRate's  columns whose  value  is not NULL  and If there is  no value for any taxrate's column  in the data, then it should Display only 'Excempt' column.
    This is my query...
    SELECT DISTINCT OSTA.Code , ORPC.DocNum AS 'Debit Note No.', ORPC.CardName AS 'Name', ORPC.CardCode AS 'code', ORPC.NumAtCard AS 'Supplier Ref.'  ,
                          RPC1.Dscription AS 'Description of Goods', ORPC.Address, RPC1.Quantity, RPC1.Price AS 'Rate', RPC1.LineTotal AS 'Amount', ORPC.DocDate,
                              (SELECT DISTINCT TaxRate
                                FROM          RPC4
                                WHERE      (staType = - 90) AND (StaCode = 'BED@10') AND (DocEntry = RPC1.DocEntry)) AS 'Basic Excise Duty BED@10 %',
                             (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_8
                                WHERE      (staType = - 60) AND (DocEntry = RPC1.DocEntry)) AS 'Education Cess @2%',
                             (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_7
                                WHERE      (staType = - 55) AND (DocEntry = RPC1.DocEntry)) AS 'Secondary Education Cess @1%',
                             (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_6
                                WHERE      (staType = 4) AND (StaCode = 'CST2') AND (DocEntry = RPC1.DocEntry)) AS 'Central Sales Tax(CST)',
                             (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_5
                                WHERE      (staType = 1) AND (StaCode = 'VAT4') AND (DocEntry = RPC1.DocEntry)) AS 'Input VAT@5%',
                              (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_4
                                WHERE      (staType = 1) AND (TaxRate = 12.500000) AND (StaCode = 'VAT12.5') AND (DocEntry = RPC1.DocEntry)) AS 'VAT12.5%',
                           (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_3
                                WHERE      (staType = 18) AND (StaCode = 'Add2') AND (DocEntry = RPC1.DocEntry)) AS 'ADD Tax 1%',
                                  (SELECT DISTINCT TaxRate
                                FROM          RPC4 AS RPC4_2
                                WHERE      (staType = 7) AND (DocEntry = RPC1.DocEntry)) AS 'Excempt'
    FROM         OSTA INNER JOIN
                          RPC4 AS RPC4_1 ON OSTA.Code = RPC4_1.StaCode CROSS JOIN
                          ORPC INNER JOIN
                          RPC1 ON ORPC.DocEntry = RPC1.DocEntry
    WHERE     (OSTA.Code IN ('BED@10','eCess 2%','HeCess 1%','CST')) AND (ORPC.CardCode = 'V00308') AND (ORPC.DocNum = '9220004')
    Kindly help me to solve this problem
    Regards
    Rahul

    Hi rahul,
    Try this:
    SELECT DISTINCT T0.DocNum AS 'Debit Note No.', T0.CardName AS 'Name', T0.CardCode AS 'code', T0.NumAtCard AS 'Supplier Ref.'
         ,T1.Dscription AS 'Description of Goods', T0.Address, T1.Quantity, T1.Price AS 'Rate', T1.LineTotal AS 'Amount', T0.DocDate,
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0)FROM RPC4 WHERE RPC4.StaType = -90 AND RPC4.DocEntry = T0.DocEntry) AS 'Basic Excise Duty BED@10 %',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = -60 AND RPC4.DocEntry = T0.DocEntry) AS 'Education Cess @2%',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = -55 AND RPC4.DocEntry = T0.DocEntry) AS 'Secondary Education Cess @1%',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 4  AND RPC4.StaCode = 'CST2' AND RPC4.DocEntry = T0.DocEntry) AS 'Central Sales Tax(CST)',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 1  AND RPC4.StaCode = 'VAT4'AND RPC4.DocEntry = T0.DocEntry) AS 'Input VAT@5%',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 1 AND RPC4.StaCode = 'VAT12.5'AND RPC4.DocEntry = T0.DocEntry) AS  'VAT12.5%',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 18 AND RPC4.StaCode = 'Add2'AND RPC4.DocEntry = T0.DocEntry) AS   'ADD Tax 1%',
         (SELECT DISTINCT ISNULL (SUM(RPC4.TaxRate),0) FROM RPC4 WHERE RPC4.StaType = 7 AND RPC4.DocEntry = T0.DocEntry) AS  'Excempt'
    FROM ORPC T0
         INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE  (T0.CardCode = 'V00308') AND (T0.DocNum = '9220004')
    FOR BROWSE
    Thanks,
    Neetu

  • Problem with display of JScrollPane

    I have made a small GUI.
    It has a JFrame and four JPanels are added to the frame.
    The placement is done by program and hence layout manager is set to null.
    Two of the panels contain JScrollPane.
    One scroll pane is associated with a JList.
    Another scroll pane is associated with a JTextArea.
    I am creating panel components in their respective paintComponent() method.
    Now my problem is whenever I run the code, the behaviour of the display of the GUI is erratic. Sometimes it appears perfectly fine other times the JList contents and JTextArea along with their scroll bars don't appear. I have tried running the code on different platforms and different systems. On some systems it works perfectly fine, on some it behaves erratically.
    Moreover my experience is that it is giving problem on somewhat lower configuration systems (low RAM and CPU) and running fine on higher configuration systems.
    I ran it on my laptop with 512MB RAM and centrino duo processor. (Both on windows and ubuntu it gave the same problem, random display behavior)
    I ran it on a desktop with 1GB RAM and higher processor (Both on windows and ubuntu it displayed fine)
    Does this problem relate to insufficient painting time or something of this sort? Why is this problem is coming and what's the solution?
    Thanks in advance.
    Also if anybody has encountered similar problem please do share so that I could at least say this is not a unique one.

    The placement is done by program and hence layout manager is set to null.That is (probably) your first problem. Learn to use use LayoutMangers, they save time in the long run.
    Sometimes it appears perfectly fine other times the JList contents and JTextArea along with their scroll bars don't appearProbably because preferred sizes are not set correctly. Since you are not using a layout manager that is your responsibility. Easy solution is to use a proper combination of layout managers.
    I am creating panel components in their respective paintComponent() method.That is (probably) your second problem. paintComponent() is for doing custom painting, not creating new components dynamically.
    I suggest you start by reading the Swing tutorial for example programs.

Maybe you are looking for

  • Where is the password for user SDM stored in sap system?

    Hi SAP Gurus, We recently changed the password of the user j2ee_admin in our dual stack system where our UME is ABAP. Now, we have made changes in the su01 and configtool but after the system restart, the user id j2ee_admin is getting intermittently

  • How to create authorization in BI 7.0 objects

    Dear Friends, how to create authorization in BI 7.0 objects. Pls any body help. tghjis is morevhelpful for me Regards Ramana

  • How to create InfoPackage Groups.

    Hi All, There are 3 infoPackages which i have to create and  include in the InfoPackage Group. Since I am not aware of InfoPackage Groups Can any body tell me the proceure and anybody can send Documents Regards, Chakri

  • Forcing invocation of private/protected methods

    Has anyone, any idea how can be forced the invocation of a private/protected method on a object. The client that invokes the method has a reference to the object and is declared in a different object than the targeted object. See code below: package

  • Screensaver Not Applying to All Workstations

    Hi, I setup our user policies to enforce a password protected screensaver (logon.scr)under Windows Desktop Preferences setting. It seems to work ok, but it isn't being applied to all workstations. The settings are consistantly applied to most worksta