A basic repaint efficiency problem

When the repaint() method of a swing component is called by some thread, but the whole swing application window is full covered by other windows, then, will the paintComponent(Graphics g) method of the component actually be called?
And why? Who takes care of this?

The paint() method is called.
Inside JComponent.paint(), the clip rectangle (the rectangle that covers all that needs to be repainted) is compared to the bounds of the component. If the bounds are such that some of the component is within the repaint area, then the component's paintComponent() method is called.
The paintChildren() is called, and each child which is within the clip rectangle is painted (with some extra work so that painting all of something deep in the Z-stack doesn't overpaint something higher-up outside the clip area).
JComponent has the responsibility of deciding which of its children to paint.
The OS's window manager has the responsibility of providing the bounds of the area that needs to be repainted.
Whether or not the repaint method is called when a window is obscured is OS dependent- on OS X, the image of any inactive window is cached, so the paint method of window 'A' won't get called if you drag window 'B' over the top of 'A', minimise and restore 'A', or move 'A' around without resizing (unless you add in extra window event handlers for those cases). On Windows NT, repaints will occur for most of these events, as it has a much less advanced windowing system.
Pete

Similar Messages

  • Basic Excise Duty problem at the time of PO genration( Dealer).

    Dear All,
    We are implmentation ECC 6.0 version.We are facing a problem in basic excise duty.I am genrating PO for dealer at that time excise duty should be in amount,this amount maintain in purchasing  condition.When we assign tax code with 0 % BED in po.BED could not copy from purchasing condition type.
    I think there was a Alternative Key (354) use in TAXINN  pricing procedure,but this could not work properly.This key was proper key or any other key use in prcing procdure.
    Any one suggest for right conclusion.
    Regards,
    Abhijit Kulkarni

    U r ? is not clear
    Hear is the process for delear case
    in Delear case u will have to maintain all the details as per raw material case
    only diffence is in the % of bed ecess and secess put 0 instade of 16 2 and 1
    at the time of po u know that u vendor will give u material at say 100 Rs increse of excise which u dont now and 4 % vat on it
    So u r po will loke like 100 basic
    bed 0
    ecess0
    scess 0
    vat 4
    total 104
    now whe u do GR
    u come to know u have 8 bed 1.6 ecess 0.8 sccess
    at the time of gr in Excise tab value
    put the excise base as 100-8-1.6-0.8 = 89.6
    and in bed 8
    ecess 1.6
    secess0.8
    and in header tab of excise in miscellaneous tab tick MRP indicator
    save ur part one and 2 posted
    then do the miro
    on item line it will show 100 as amount change it to 89.6
    click on calculate tax
    and ur excate payment of rs 104 will be done to vendor
    this the the correct process of Delear case
    Hope this is help full
    Reward if usefull

  • Basic auth interop problem, servlet WS works, EJB WS not (Sun AS 8)

    After spending some time I managed to add HTTP basic auth to a simple web service. I have implemented two variants, an JAX-RPC servlet web service and an EJB web service.
    A (Sun) JAX-RPC client works pretty well against both web services. I do the required steps with the stub (set user/pwd) and things work. I do get the correct principal in the server side, fine.
    When I do NOT set the authentication properties at the stub, the servlet based WS responds something like HTTP error 403 (?) or so, which leads to "authentication required". The EJB based response is not that adequate, it's something like "internal server error, EJBLocalAccessException or so" but from the given message you could get the idea what's wrong.
    Anyway, I got the impression that this stuff
    return HTTP error to flag "auth required"
    is not happening for some reason in my EJB based web service. I found this problem in Sun AS 8 and I think it's the same problem when I test stuff with Oracle's OC4J ...
    Some client implementations have obviously problems to get the idea that user authentication is required. In other words, the clients cannot invoke the EJB WS. I tried it with Perl Soap::Lite, MS SOAP Toolkit 3.0 and MS .Net 1.1 stuff. All this clients work well (with authentication) when I consume the servlet based web service. But the EJB based web service is not working at all. I do get there just "not allowed" and the SOAP client runtime is not handing over any user credentials (because it's obviously not correctly asked for it by an appropriate AS response).
    Anyone else experienced this problems with EJB WS???
    Interesting question: why is the JAX-RPC client working? Is it sending the properties set at the stub in any case? Or do they "handle" the internal error coming from Sun AS explicitly or so? Strange, in a way. :-)
    Thanx for any help here!
    Merten

    I guess the reason was that I wrote
    <login-config>
    <auth-method>Basic</auth-method>
    </login-config>
    instead of required
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    At deploy time, I got no error message. At usage time, I just got this AccessLocalException. That's not really nice ...
    Merten

  • Basic doubt and problem with my query

    Hi friends
    I am pretty new to this xquery .I had to learn and implement it in my project.We have many rules to follow so basically i have an XML already provided.I need to work on several issues.When i am working i have come across different errors or very small minor problems.here is question1
    1)i am trying to find the LArgest population in whole..Here is the quesry i am using
    declare variable $xmldoc1:= doc("mondial-3.0.xml");
    *<project>*
    let $test := max($xmldoc1/mondial/country/@population)
    for $a in $xmldoc1/mondial/country where  $a/encompassed/@continent ="f0_132" and $a/@population=$test
    return
    *<country>*
    *{$a/name}*
    *</country>*
    *</project*
    I am not able to display any thing but when i take out the condition $a/@population=$test out i am able to see all the name..
    Help me friends ..THank you

    The query doesn't return anything because, most likely, the country with max population doesn't belong to the continent whose id = "f0_132", simple as that.
    Remove the following condition and see the difference :
    $a/encompassed/@continent ="f0_132"
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Repaint(Rectangle ) problem

    Hi, anyone knows any problems calling repaint with a Rectangle parameter when the component doesn't fit in the window ( both width and height ).
    I'm trying to repaint an area delimited by a Rectangle, but when its bounds are outside of the window, width and height it doesnt repaint the area. Any idea ? thanks

    If you want to eliminate 'Flicker' in Java you have to override the update(Graphics g) method found in the java.awt.Container class.
    A call to repaint() calls update(Graphics g) first which by default clears the painting surface by painting with the background color (this causes flicker on a large area) after this there is a call to paint(Graphics g).
    There are two ways to proceed. Use 'clipping' if the area that is changing is quite small e.g. numbers on a digital clock or use 'double buffering' if the area is larger e.g. large animation.

  • A very basic but trick problem--can u handel it

    hi guys
    i have a very small but tricky problem
    u see i want to get the value of a mathamatical expression (stored in a variable -varchar2) and wants to get the mathamatical value of the expression
    eg
    declare
    a varchar2;
    begin
    a:='12*12';
    etc....
    end ;
    so here i want to get 144 as the output ..
    lets see how u handel it
    thanx
    dg

    you can change the value assigned to variable S1 to whatever operation you need to perform.
    DECLARE
         V_HANDLE     INTEGER;
         STMT          VARCHAR2(100);
         S1               VARCHAR2(50) := '12/2';
         RES               INTEGER;
    BEGIN
         V_HANDLE := DBMS_SQL.OPEN_CURSOR;
         STMT := 'SELECT '||S1||' FROM DUAL';
         DBMS_SQL.PARSE(V_HANDLE, STMT, DBMS_SQL.NATIVE);
         DBMS_SQL.DEFINE_COLUMN(V_HANDLE, 1, 1);
         RES     := DBMS_SQL.EXECUTE(V_HANDLE);
         LOOP
              EXIT WHEN DBMS_SQL.FETCH_ROWS(V_HANDLE) = 0;
              DBMS_SQL.COLUMN_VALUE(V_HANDLE, 1, RES);
              DBMS_OUTPUT.PUT_LINE('RES = '||RES);
         END LOOP;
         DBMS_SQL.CLOSE_CURSOR (V_HANDLE);
    END;

  • O Dear! Basic Java Programming problem!

    import java.lang.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.util.Random;
    public class QuizApp extends Object
         public static void main(String[] argStrings) throws Exception
              Random random = new Random();
              int generateFirstFigure = random.nextInt(21);
              int generateSecondFigure = random.nextInt(31);
              int generateOperator = random.nextInt(3);
              String operator = "/";
              int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 0)
                   operator = "+";
                   int correctAnswer = generateFirstFigure + generateSecondFigure;
              if (generateOperator == 1)
                   operator = "-";
                   int correctAnswer = generateFirstFigure - generateSecondFigure;
              if (generateOperator == 2)
                   operator = "/";
                   int correctAnswer = generateFirstFigure / generateSecondFigure;
              //int correctAnswer = generateFirstFigure + operator + generateSecondFigure;
              int incorrectAnswerOne = correctAnswer -2;
              int incorrectAnswerTwo = correctAnswer + 1;
              int incorrectAnswerThree = correctAnswer + 3;
              String questionOne = "What is " + generateFirstFigure + operator + generateSecondFigure + "?"; 
              System.out.println(questionOne);
              System.out.println(incorrectAnswerThree);
              System.out.println(incorrectAnswerOne);
              System.out.println(correctAnswer);
              System.out.println(incorrectAnswerTwo);
    }Basically this code, creates 2 random characters and then allows you to either add, divide or subtract the two numbers... firstly this bit of the code doesnt work, secondly how can the user input a value (the answer) to the math's question?
    Thanks for help,
    Joel

    practissum wrote:
    dketcham, i printed out your hello world pumpkin. its a huge hit in the office!Sorry for propogating the off-topic remarks...but link to the hello world pumpkin?it was the friday coding challenge for last week:
    http://forum.java.sun.com/thread.jspa?threadID=5230548&messageID=9941964#9941964
    It's all about the pretty colors, and trying to squish a simple little program into a squarish-shape, so that another shape can be put within!
    As you can see, I have no real programming skills, but I like pretty colors, so it's all good.

  • 'Basic Content Download' Problems

    Hi, I've got a fairly average broadband internet connection and the 'basic content download' page that loads before you open your first session has been taking hours.  The progress bar on the bottom doesn't even appear, let alone move.  Should I keep waiting or is there a fix?

    No.. not OS X.. but Logic itself.
    A new version was released that has a fix for 'stalling' downloads.. That version is v10.0.1. You may have actually downloaded 10.0.0 and didn't get the newer 10.0.1 version depending on when you started the process as 10.0.1 was released very recently. You can check by going to the Logic Pro X Menu bar and selecting Logic Pro X/About Logic Pro X. The version number is located just below the large Logic Pro X Title in the  'silver' window that opens..
    If it says 10.0.0 then quit Logic and go to the App Store application and select Updates and download the updated 10.0.1 version..
    If you have 10.0.1 then, make sure you have turned off any firewalls such as Little Snitch for example.
    Other than that... it's hard to say what your issue might be.. in which case, contact Apple directly for more personal help..

  • Linksys WRT54G V8 Basic Setup page problems

    I have been trying to change my password and all the settings on my WRT54G V8 router today because I forgot the password, and I can't seem to navigate the Basic Setup page. I can log in (most of the time) after resetting the router, but whenever I try to click on a different tab (like "Wireless", or "Security") it comes up with the page saying "This Page Cannot Be Displayed."  I'd like to be able to put a password on it (which I have successfully done before on this router) because I live in a college dorm and would like to keep my internet from being bogged down by other people using it. 
    Any help would be greatly appreciated.

    Tatonka,
    I assume you downloaded the WRT54G setup software disk into your PC initially. Reset the router (hold in the reset button for 30 seconds), hard wire your PC to the router, and access the Linksys icon on your desktop. Just follow the prompts after that. I had to do exactly this at my daughter's home last evening. Bob

  • Basic launch image problem iPhone 6+

    I can’t get good launch-image performance on iPhone 6 + , iOS 8.3,  using AIR v 17 and publishing with Flash Pro CS5.5
    I’ve tested what I understand to be correct launch-image dimensions and names: 1242 x 2208 and  ‘[email protected]
    I’ve also tested:
    ‘Default-414w-736h@3x~iphone.png’
    ‘[email protected]
    I create a 1080 x 1920 stage, add the launch image and get:
    Letter-boxing is supplied by iPhone! I've drawn test lines on my stage, which has been shortened lengthwise courtesy of iOS 8.3
    I've read that people were having problems like this many months ago, but that they've been resolved in the lastest AIR releases. So it must be me. What am I doing wrong?
    And, as a follow up question, is it possible to add launch-image info to the application descriptor .xml that will be picked up in the app's info.plist?

    Ok, answering my own question (sometimes you just have to ask in order to find the answer!):
    Contrary to Adobe's instructions in Guide for Apple App Store submissions | Adobe Developer Connection ("Launch images are included in the root directory of the application package but are not referenced in the publish settings or application descriptor"), the launch image for, at least iOS 8, MUST BE referenced in the application descriptor in order to get into the app bundle's info.plist. 
    Unlike earlier iOS versions the launch image seems to have to be referenced in that info.plist.
    If I'm missing anything here please supply info, corrections. 
    Thanks, c.u.

  • Explict cursor on 6i form - efficiency problem

    Hello:
    I have created a form with an explicit cursor that loops though a table and as part of the loop, uses TEXT_IO to output to a file. The problem is that this process is slow-- took just over 8 minutes just to write 5000 records. I think that since the cursor is executing from the client, as part of a WHEN_BUTTON_PRESSED trigger, is the reason the process is so slow. Anyone have any ideas on how to speed up this process? I am thinking that turning this as a procedure that could run on the server instead would make it faster but I am not sure how I should do that due to the TEXT_IO being part of the loop. Also, I have a sql/Plus program that spools tables to text files and is extremly fast but I can't have my end users working in sql/plus. Would be nice if I could run that program from a form. Anyway, below is the code I am currently using in the form trigger:
    DECLARE
    V_F_NAME     VARCHAR2(25)      := NULL;
    V_L_NAME     VARCHAR2(25)      := NULL;
    v_M_INT          varchar2(25) := NULL;
    out_file     Text_IO.File_Type;
         cursor vw_cursor is
                   select * from tbl_my_table;
                   vw_record vw_cursor%rowtype;
    BEGIN
         V_F_NAME                     := :ctl.v_F_NAME;
         V_L_NAME                     := :ctl.v_L_NAME;
         v_M_INT                         := :ctl.v_M_INT;
    -- OPEN FILE
    out_file := Text_IO.Fopen('C:\BAT\MyFile.txt', 'w');
                   open vw_cursor;
                   LOOP
                        fetch vw_cursor into vw_record ;
                        exit when vw_cursor%notfound;
              --PRINT TO FILE... 
              if v_f_name is not null then
              v_f_name := vw_record.f_name || ',';
              if v_L_NAME is not NULL THEN
              v_L_NAME := vw_record.l_name || ',';
              if v_M_INT IS NOT NULL THEN
              v_M_INT := vw_record.M_INT || ',';
              END IF;
              END IF;
              END IF;
              text_io.putf(out_file, v_f_name ||
                        v_l_name ||
                        v_M_INT);
              Text_IO.New_Line(out_file);
              END LOOP;
              CLOSE vw_cursor ; -- remember to close the cursor! ;)
    -- CLOSE FILE
         TEXT_IO.FCLOSE(OUT_FILE);
    END ;

    Depends on how you populate the array - if you populate it server side and send the whole pl/sql table back then it may be quicker.
    Record group population uses a fatch size of 100 records at a time.
    It also would ve quicker to use text_io.putf() to write multiple lines at once to the file, but this depends on you adding the line breaks as \n yourself

  • Basic Graphics_Textures overlap problem

    Sorry if this is a newb question. In Illustrator CC v17.0.2, I'm trying to do a simple Appearance on a Fill using a default diamond pattern from Adobe pattern swatches. But the texture seems to overlap always Notice in the diamond swatch that is selected and in the orange background there are 6 verticle "lines" where the diamond pattern seems to be overlapping in this screenshot:
    Basic steps:
    1. Create a blank doc
    2. Create a rectangle and fill with orange gradient and remove stroke.
    3. On the Appearance for the rectangle in step 2 apply Fill with an Adobe pattern swatch "Basic Graphics_Textures" selecting the Diamond pattern.
    4. Notice the overlap of the diamonds.
    I just want it to be smooth diamonds. There must be something I'm doing wrong. This can't possibly be the default is to overlap. Frustrated.
    Thanks in advance for any help,
    Max

    Hi
    This pattern swatch is as far as I can see intended to have a kind of "shimmer" and the overlap is intentional. If you take a look at the swatch and the pattern's contents (drag the swatch onto an empty part of your artboard) you'll clearly see it.
    You need to find or create a new swatch - very easy with the pattern tools.

  • Basic JavaScript addition problem

    I'm trying to create a customized calculator in an APEX popup page using JavaScript and I keep getting caught on JavaScripts use of the + for both addition and concatenation operators. Is there a way to fix this? I'm ONLY using basic arithmetic operations, but I can't seem to find a way to declare a variable as a NUMBER the way I can in PL/SQL.
    Here's my function:
    <script language="JavaScript" type="text/javascript">
      function calcBMI(formItem1, formItem2, formItem3, formItem4) {
        var bmift = document.getElementById(formItem1).value;
        var bmiin = document.getElementById(formItem2).value;
        var bmiht = bmift*12;
        var bmiht = bmiht + bmiin;
        var bmiwt = document.getElementById(formItem3).value*703;
        var bmi   = bmiwt/bmiht^2;
        document.getElementById(formItem4).value = bmi;
    </script>I need to add the height in feet to the height in inches, but instead of 5'4" = 64, I'm getting 604.

    So here's the final function:
    <script language="JavaScript" type="text/javascript">
      function calcBMI(formItem1, formItem2, formItem3, formItem4) {
        var bmift = document.getElementById(formItem1).value;
        var bmiin = document.getElementById(formItem2).value;
        var bmiht = bmift*12 + parseInt(bmiin);
        var bmiwt = document.getElementById(formItem3).value*703;
        var bmi   = Math.round(bmiwt/(bmiht*bmiht)*100)/100;
        document.getElementById(formItem4).value = bmi;
    </script>

  • Basic midi playback problems

    I am playing with the demo for logic express 7 and having a bit of a problem with playing back midi.
    I am inputting from a korg sp 300 through an edirol ua-20 and it records ok but only seems to play back from logic through the korgs speakers. I want to be able to play it back through the main mix to my amp and speakers. audio tracks like vox and guitars are fine.
    It must be pretty simple but i just cant find the answer?

    The midi tracks are only telling the Korg what to play, so you're going to hear the sound from wherever the Korg's sounds come out. If you want to hear the sounds from the speakers, you'll need to route the audio outputs from the Korg to your amp. There may be a way to do that with your interface; otherwise you may need a mixer. That's the old-school midi way (pre software instruments).

  • Extremely Basic Program - 1 Problem

    This was assigned to me in my introductory Java class:
    Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values, not counting zeros. Your program ends with the input 0. Display the average as a floating-point number.
    Here is the program I have written:
    import javax.swing.JOptionPane;
    public class AverageHW{
    public static void main(String[] args){
    int total, i;
    double a, total2, i2;
    int num, neg, pos;
    neg = 0;
    pos = 0;
    total = 0;
    i = 0;
    while(1>0)
    String input;
    input = JOptionPane.showInputDialog(null,
    "Enter a number to be averaged.",
    "Enter",
    JOptionPane.QUESTION_MESSAGE);
    num = Integer.parseInt(input);
    total += num;
    ++i;
    if (num<0)
         neg++;
    if (num>0)
         pos++;
    if (num==0)
    break;
    a = (double)total / (double)i;
    System.out.println("The sum is " + total);
    System.out.println("The average is obviously not " + a);    // Just a joke.. like my skills in Java
    System.out.println("There are " + neg + " negative inputs." );
    System.out.println("There are " + pos + " positive inputs.");
    System.out.println("There are " + (i - 1) + " combined inputs.");
    System.out.println("This is quite frustrating.");
    }Getting a correct average is the only thing I'm lacking.
    I might be missing something in the chapters I've studied that is keeping me from attaining a floating point average. My teacher also explained this to me before, and I forgot it. Tried searching all over the net and trying different things but to no avail. I know the answer must be extremely simple, but this seems to be the only thing holding me back, as you can see.
    Also, this isn't the only reason I posted this. I'd like to get feedback on potentially alternative and more efficient methods of coding this program. I know I have different options as far as using alternative loops and such, but just some insight would be helpful.
    Thank you!
    EDIT I know i have some random useless crap variables thrown in there, but those are the leftovers of me messing around with getting that average (tried making all the variables in the average equation double variables).
    Edited by: g_0_0_d4 on Dec 17, 2009 12:46 AM

    After reading your post pbrock, I was able to realize my mistake. "i" does not actually read the total numbers correctly, which is why I put "There are " + (i-1) + " combined inputs." I realized this earlier, but it never really registered that it was the compilation error that was causing the average to calculate incorrectly.
    New code:
    import javax.swing.JOptionPane;
    public class AverageHW{
    public static void main(String[] args){
    int total, i;
    double a, total2, i2;
    int num;
    int neg, pos;
    neg = 0;
    pos = 0;
    total = 0;
    i = 0;
    while(1>0)
    String input;
    input = JOptionPane.showInputDialog(null,
    "Enter a number to be averaged.",
    "Enter",
    JOptionPane.QUESTION_MESSAGE);
    num = Integer.parseInt(input);
    total += num;
    i++;
    if (num<0)
         neg++;
    if (num>0)
         pos++;
    if (num==0)
    break;
    i = (i-1);
    a = (double)total / (double)i;
    System.out.println("The sum is " + total);
    System.out.println("The average is " + a);
    System.out.println("There are " + neg + " negative inputs." );
    System.out.println("There are " + pos + " positive inputs.");
    System.out.println("There are " + i + " combined inputs.");
    System.out.println("SUCCESS!");
    JOptionPane.showMessageDialog(null,
    "You have averaged your numbers.",
    "Exit",
    JOptionPane.INFORMATION_MESSAGE);
    }Just removed (i-1) from the System.out.println and set i = i-1, it feels so good to finally finish.
    Mel, your help is greatly appreciated. I should have known to use a boolean expression to determine the positive and negative numbers, but it kind of slipped my mind while I was writing this. The program you wrote is a little too advanced for my understanding, but I copy it down and study it for the future.
    Thanks everyone!

Maybe you are looking for

  • Will not start.

    I have a Satellite L645D, and everytime I try to turn it on, Boot Manager comes up and says: "Windows has encountered a problem comunicating with a device connected to your computer" Then it gives reasons as to why it happened such as unplugging a re

  • Webutil_file_transfer needed btw AS and DB

    As I posted in May 04, the header of the webutil_file_transfer package spec says: * TODO: * 2) Add functionality to Upload / Download from App Server Filesystem to / from the Database This would be VERY useful in cutting out redundant slow transfers.

  • How can i find my contact card

    Im told siri than i was in a relationship and now im trying to remove it. i tried to edit in the contact but there was no relations there. i also tried deleting the contact but siri still recongnize that im in a relationship i want to delete it.

  • Captivate will not run in IE 7.0

    The published html file will not run in IE 7.0. You can see the frame of the file, but nothing displays.

  • IPad screen backlit but blank

    I have struck a real problem with my iPad and I have tried everything to fix it. The problem is as follows: The screen is blank but is glowing with the backlight After pushing the home button, if I slide my finger across the bottom of the screen I ca