Why Swing instead of...

This is a quote from the Java Tutorial:
Note: We strongly recommend that instead of using the AWT components shown on this page, you
use Swing components instead.
Then why talk about both? Both need to be understood depending on the job?

You need to understand AWT when using Swing if for no other reason that Swing is built on top of AWT.
Col

Similar Messages

  • Why assertion instead of if statement ?  Which is better to use ?

    Why assertion instead of if statement ? Which is better to use ?

    Never assertion instead of if statement. The two have fundamentally different intents. Using assert to control program flow is a bad idea

  • Why NL instead of HJ(query takes long)

    Hi there!
    There are a db(10.2.0.5 RAC), SLES 10 and two schemes.In the first schema query takes very fast:
    SQL> explain plan for
                 select  count(distinct c.unit)
               from quantity_comp_v qc, comps c, noticequant nq, notices_table n,    noticediss nd
                  where
                  c.id = qc.comp
                  and nq.quant = qc.quantity
                  and n.id = nq.note
                  and n.type_id = 2
                       and nq.link = 2
                  and nd.note = n.id
                  and n.trust >=0
                and nd.dis in (select dr.dismbr from disrelflat dr where dr.disgrp = 1080801245);
    Explained.
    Elapsed: 00:00:00.27
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2567928671
    | Id  | Operation                              | Name                           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                       |                                |     1 |    91 |       |  2099   (4)| 00:00:07 |
    |   1 |  SORT GROUP BY                         |                                |     1 |    91 |       |            |          |
    |*  2 |   HASH JOIN                            |                                | 55203 |  4905K|       |  2099   (4)| 00:00:07 |
    |*  3 |    INDEX RANGE SCAN                    | DISRELFLAT_UI_DISGRP_DISMBR    | 10618 |   155K|       |    54   (2)| 00:00:01 |
    |*  4 |    HASH JOIN                           |                                | 42398 |  3146K|  2984K|  2043   (4)| 00:00:06 |
    |*  5 |     HASH JOIN                          |                                | 42398 |  2484K|       |  1262   (4)| 00:00:04 |
    |*  6 |      HASH JOIN                         |                                | 24173 |  1109K|       |  1022   (4)| 00:00:03 |
    |*  7 |       HASH JOIN                        |                                | 21471 |   650K|       |   951   (3)| 00:00:03 |
    |*  8 |        VIEW                            | index$_join$_004               | 21471 |   314K|       |   783   (3)| 00:00:03 |
    |*  9 |         HASH JOIN                      |                                |       |       |       |            |          |
    |* 10 |          INDEX RANGE SCAN              | NOTICES_TABLE_I_TYPE_ID_TRUST_ | 21471 |   314K|       |   141   (5)| 00:00:01 |
    |  11 |          INDEX FAST FULL SCAN          | NOTICES_TABLE_PK               | 21471 |   314K|       |   832   (2)| 00:00:03 |
    |  12 |        INDEX FAST FULL SCAN            | NOTICEDISS_UI_NOTE_DIS         |   169K|  2647K|       |   162   (4)| 00:00:01 |
    |* 13 |       TABLE ACCESS FULL                | NOTICEQUANT                    | 38141 |   595K|       |    69   (5)| 00:00:01 |
    |  14 |      VIEW                              |                                | 88786 |  1127K|       |   236   (3)| 00:00:01 |
    |  15 |       SORT UNIQUE                      |                                |       |       |       |            |          |
    |  16 |        UNION-ALL                       |                                |       |       |       |            |          |
    |* 17 |         HASH JOIN                      |                                | 23140 |  1355K|       |   130   (8)| 00:00:01 |
    |  18 |          INDEX FAST FULL SCAN          | QUANTITIES_I_ID_OP             | 50822 |   397K|       |    51   (4)| 00:00:01 |
    |* 19 |          HASH JOIN                     |                                | 23057 |  1170K|       |    76   (7)| 00:00:01 |
    |  20 |           INDEX FAST FULL SCAN         | QOPNC_I_ALL                    | 37964 |   481K|       |    55   (2)| 00:00:01 |
    |  21 |           VIEW                         |                                | 23057 |   878K|       |    18   (6)| 00:00:01 |
    |* 22 |            CONNECT BY WITHOUT FILTERING|                                |       |       |       |            |          |
    |  23 |             TABLE ACCESS FULL          | QOPNQ                          | 23057 |   225K|       |    18   (6)| 00:00:01 |
    |* 24 |         HASH JOIN                      |                                | 38100 |   781K|       |   109   (6)| 00:00:01 |
    |  25 |          INDEX FAST FULL SCAN          | QOPNC_I_ALL                    | 37964 |   481K|       |    55   (2)| 00:00:01 |
    |  26 |          INDEX FAST FULL SCAN          | QUANTITIES_I_ID_OP             | 50822 |   397K|       |    51   (4)| 00:00:01 |
    |  27 |     TABLE ACCESS FULL                  | COMPS                          |   218K|  3406K|       |   282   (4)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("ND"."DIS"="DR"."DISMBR")
       3 - access("DR"."DISGRP"=1080801245)
       4 - access("C"."ID"="COMP")
       5 - access("NQ"."QUANT"="ID")
       6 - access("NQ"."NOTE"="N"."ID")
       7 - access("ND"."NOTE"="N"."ID")
       8 - filter("N"."TYPE_ID"=2 AND "N"."TRUST">=0)
       9 - access(ROWID=ROWID)
      10 - access("N"."TYPE_ID"=2 AND "N"."TRUST">=0)
      13 - filter("NQ"."LINK"=2)
      17 - access("ID"="RT")
      19 - access("QOP"="QUANTITY")
      22 - access("QUANTITY"=PRIOR "QOP")
      24 - access("ID"="QUANTITY")
    52 rows selected.
    Elapsed: 00:00:00.06
    SQL> In second schema query takes very long:
    PLAN_TABLE_OUTPUT
    Plan hash value: 543063124
    | Id  | Operation                             | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                      |                             |     1 |    92 |   333   (2)| 00:00:01 |
    |   1 |  SORT GROUP BY                        |                             |     1 |    92 |            |          |
    |   2 |   NESTED LOOPS                        |                             |    91 |  8372 |   333   (2)| 00:00:01 |
    |   3 |    NESTED LOOPS                       |                             |    91 |  6916 |   241   (2)| 00:00:01 |
    |   4 |     NESTED LOOPS                      |                             |    52 |  3276 |   189   (2)| 00:00:01 |
    |   5 |      NESTED LOOPS                     |                             |    47 |  2209 |   123   (3)| 00:00:01 |
    |*  6 |       HASH JOIN                       |                             |    81 |  2592 |    42   (8)| 00:00:01 |
    |*  7 |        INDEX RANGE SCAN               | DISRELFLAT_UI_DISGRP_DISMBR |    18 |   288 |     2   (0)| 00:00:01 |
    |   8 |        INDEX FAST FULL SCAN           | NOTICEDISS_UI_NOTE_DIS      | 38127 |   595K|    38   (3)| 00:00:01 |
    |*  9 |       TABLE ACCESS BY INDEX ROWID     | NOTICES_TABLE               |     1 |    15 |     1   (0)| 00:00:01 |
    |* 10 |        INDEX UNIQUE SCAN              | NOTICES_TABLE_PK            |     1 |       |     0   (0)| 00:00:01 |
    |* 11 |      TABLE ACCESS BY INDEX ROWID      | NOTICEQUANT                 |     1 |    16 |     3   (0)| 00:00:01 |
    |* 12 |       INDEX RANGE SCAN                | NOTICEQUANT_UI_NOTE_QUANT   |     1 |       |     1   (0)| 00:00:01 |
    |  13 |     VIEW                              |                             |     2 |    26 |     1   (0)| 00:00:01 |
    |  14 |      SORT UNIQUE                      |                             |       |       |            |          |
    |  15 |       UNION-ALL PARTITION             |                             |       |       |            |          |
    |  16 |        NESTED LOOPS                   |                             |     1 |    60 |    19   (6)| 00:00:01 |
    |  17 |         NESTED LOOPS                  |                             |     1 |    47 |    18   (6)| 00:00:01 |
    |* 18 |          INDEX RANGE SCAN             | QUANTITIES_UI_ID_OP         |     1 |     8 |     2   (0)| 00:00:01 |
    |* 19 |          VIEW                         |                             |     1 |    39 |    16   (7)| 00:00:01 |
    |* 20 |           CONNECT BY WITHOUT FILTERING|                             |       |       |            |          |
    |  21 |            TABLE ACCESS FULL          | QOPNQ                       | 19811 |   193K|    16   (7)| 00:00:01 |
    |* 22 |         INDEX RANGE SCAN              | QOPNC_UI_QUANTITY_NUM_COMP  |     1 |    13 |     1   (0)| 00:00:01 |
    |  23 |        NESTED LOOPS                   |                             |     1 |    21 |     3   (0)| 00:00:01 |
    |* 24 |         INDEX RANGE SCAN              | QUANTITIES_UI_ID_OP         |     1 |     8 |     2   (0)| 00:00:01 |
    |* 25 |         INDEX RANGE SCAN              | QOPNC_UI_QUANTITY_NUM_COMP  |     1 |    13 |     1   (0)| 00:00:01 |
    |  26 |    TABLE ACCESS BY INDEX ROWID        | COMPS                       |     1 |    16 |     1   (0)| 00:00:01 |
    |* 27 |     INDEX UNIQUE SCAN                 | COMPS_UI_ID                 |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       6 - access("ND"."DIS"="DR"."DISMBR")
       7 - access("DR"."DISGRP"=1080801245)
       9 - filter("N"."TYPE_ID"=2 AND "N"."TRUST">=0)
      10 - access("ND"."NOTE"="N"."ID")
      11 - filter("NQ"."LINK"=2)
      12 - access("NQ"."NOTE"="N"."ID")
      18 - access("ID"="NQ"."QUANT")
      19 - filter("ID"="RT" AND "RT"="NQ"."QUANT")
      20 - access("QUANTITY"=PRIOR "QOP")
      22 - access("QOP"="QUANTITY")
      24 - access("ID"="NQ"."QUANT")
      25 - access("QUANTITY"="NQ"."QUANT")
           filter("ID"="QUANTITY")
      27 - access("C"."ID"="COMP")As you can see, plans are different. Why? Statistics is up-to-date in both schemas.
    In tkprof trace for the second schema i see strange thing:
    select count(distinct c.unit)
    from quantity_comp_v qc, comps c, noticequant nq, notices_table n,
    noticediss nd
    where
    c.id = qc.comp
    and nq.quant = qc.quantity
    and n.id = nq.note
    and n.type_id = 2
    and nq.link = 2
    and nd.note = n.id
    and n.trust >=0
    and nd.dis in (select dr.dismbr from disrelflat dr where dr.disgrp = 1080801245)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.02       0.02          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2    558.36     545.39          1     845921          0           1
    total        4    558.38     545.42          1     845921          0           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 156
    Rows     Row Source Operation
          1  SORT GROUP BY (cr=845921 pr=1 pw=0 time=545397464 us)
      13865   NESTED LOOPS  (cr=845921 pr=1 pw=0 time=546471010 us)
      13865    NESTED LOOPS  (cr=818189 pr=1 pw=0 time=546290764 us)
      13308     HASH JOIN  (cr=31053 pr=1 pw=0 time=172231 us)
      13308      NESTED LOOPS  (cr=30863 pr=0 pw=0 time=126100 us)
      15326       HASH JOIN  (cr=209 pr=0 pw=0 time=21640 us)
      11522        INDEX RANGE SCAN DISRELFLAT_UI_DISGRP_DISMBR (cr=68 pr=0 pw=0 time=40 us)(object id 634347)
      37432        INDEX FAST FULL SCAN NOTICEDISS_UI_NOTE_DIS (cr=141 pr=0 pw=0 time=50 us)(object id 638914)
      13308       TABLE ACCESS BY INDEX ROWID NOTICES_TABLE (cr=30654 pr=0 pw=0 time=95620 us)
      15326        INDEX UNIQUE SCAN NOTICES_TABLE_PK (cr=15328 pr=0 pw=0 time=41398 us)(object id 638937)
      34391      TABLE ACCESS FULL NOTICEQUANT (cr=190 pr=1 pw=0 time=53 us)
      13865     VIEW  (cr=787136 pr=0 pw=0 time=544908246 us)
      13865      SORT UNIQUE (cr=787136 pr=0 pw=0 time=544893509 us)
      13950       UNION-ALL PARTITION (cr=787136 pr=0 pw=0 time=539509573 us)
       1223        NESTED LOOPS  (cr=733813 pr=0 pw=0 time=539271493 us)
       1233         NESTED LOOPS  (cr=731971 pr=0 pw=0 time=539245389 us)
      13308          INDEX RANGE SCAN QUANTITIES_UI_ID_OP (cr=26647 pr=0 pw=0 time=120240 us)(object id 634738)
       1233          VIEW  (cr=705324 pr=0 pw=0 time=539109785 us)
    275435676           CONNECT BY WITHOUT FILTERING (cr=705324 pr=0 pw=0 time=493869861 us)
    263644788            TABLE ACCESS FULL QOPNQ (cr=705324 pr=0 pw=0 time=163378 us)
       1223         INDEX RANGE SCAN QOPNC_UI_QUANTITY_NUM_COMP (cr=1842 pr=0 pw=0 time=10296 us)(object id 634729)
      12727        NESTED LOOPS  (cr=53323 pr=0 pw=0 time=216730 us)
      13308         INDEX RANGE SCAN QUANTITIES_UI_ID_OP (cr=26647 pr=0 pw=0 time=111770 us)(object id 634738)
      12727         INDEX RANGE SCAN QOPNC_UI_QUANTITY_NUM_COMP (cr=26676 pr=0 pw=0 time=84638 us)(object id 634729)
      13865    TABLE ACCESS BY INDEX ROWID COMPS (cr=27732 pr=0 pw=0 time=235066 us)
      13865     INDEX UNIQUE SCAN COMPS_UI_ID (cr=13867 pr=0 pw=0 time=128663 us)(object id 634315)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      gc current block 3-way                        208        0.00          0.08
      gc current block 2-way                         93        0.00          0.02
      gc cr multi block request                     150        0.00          0.01
      db file sequential read                         1        0.01          0.01
      SQL*Net message from client                     2        0.00          0.00
    ********************************************************************************Cardinality of QOPNQ not real (over 263 millions rows instead of 19 thousands). If i set optimizer_index_cost_adj=400, plan uses HJ and cardinality in tkprof trace is right. Thanks in advance.
    Best regards, Pavel.

    Hi there.
    What I found:
    In schema, where optimizer uses NL:
    SQL> select TABLE_NAME,COLUMN_NAME,NUM_BUCKETS,LAST_ANALYZED from user_tab_col_statistics where table_name in ('DISRELFLAT','NOTICES_TABLE','QOPNQ','COMPS');
    TABLE_NAME           COLUMN_NAME      NUM_BUCKETS LAST_ANALYZED
    COMPS                ID                       254 31-JUL-10
    COMPS                UNIT                     254 31-JUL-10
    COMPS                LOC                       34 31-JUL-10
    COMPS                TIS                      246 31-JUL-10
    COMPS                RTYP                       2 31-JUL-10
    DISRELFLAT           DISGRP                   254 31-JUL-10
    DISRELFLAT           DISMBR                   254 31-JUL-10
    DISRELFLAT           CNT                      174 31-JUL-10
    DISRELFLAT           SPL                       10 31-JUL-10
    DISRELFLAT           DIST                      16 31-JUL-10
    DISRELFLAT           PART                       2 31-JUL-10
    DISRELFLAT           ISA                        2 31-JUL-10
    DISRELFLAT           MIX                        2 31-JUL-10
    DISRELFLAT           CLONAL                     1 31-JUL-10
    NOTICES_TABLE        ID                         1 08-SEP-10
    NOTICES_TABLE        TEXT                       1 08-SEP-10
    NOTICES_TABLE        DESCRIPTION                1 08-SEP-10
    NOTICES_TABLE        TYPE_ID                    4 08-SEP-10
    NOTICES_TABLE        CUSER_ID                   1 08-SEP-10
    NOTICES_TABLE        CDATE                      1 08-SEP-10
    NOTICES_TABLE        TRUST                     10 08-SEP-10
    NOTICES_TABLE        RTYP                       2 08-SEP-10
    NOTICES_TABLE        CHECKEDBY                  1 08-SEP-10
    NOTICES_TABLE        FEATURE_ID                13 08-SEP-10
    QOPNQ                QUANTITY                   1 31-JUL-10
    QOPNQ                NUM                       12 31-JUL-10
    QOPNQ                QOP                        1 31-JUL-10
    27 rows selected.In schema where optimizer uses HJ:
    TABLE_NAME           COLUMN_NAME      NUM_BUCKETS LAST_ANALYZED
    COMPS                ID                       254 28-JUL-10
    COMPS                UNIT                     254 28-JUL-10
    COMPS                LOC                       29 28-JUL-10
    COMPS                TIS                      223 28-JUL-10
    COMPS                RTYP                       2 28-JUL-10
    DISRELFLAT           DISGRP                   254 21-AUG-10
    DISRELFLAT           DISMBR                     1 21-AUG-10
    DISRELFLAT           CNT                      103 21-AUG-10
    DISRELFLAT           SPL                       10 21-AUG-10
    DISRELFLAT           DIST                      11 21-AUG-10
    DISRELFLAT           PART                       2 21-AUG-10
    DISRELFLAT           ISA                        2 21-AUG-10
    DISRELFLAT           MIX                        2 21-AUG-10
    DISRELFLAT           CLONAL                     2 21-AUG-10
    NOTICES_TABLE        ID                         1 09-AUG-10
    NOTICES_TABLE        TEXT                     254 09-AUG-10
    NOTICES_TABLE        DESCRIPTION              254 09-AUG-10
    NOTICES_TABLE        TYPE_ID                    4 09-AUG-10
    NOTICES_TABLE        CUSER_ID                   1 09-AUG-10
    NOTICES_TABLE        CDATE                    254 09-AUG-10
    NOTICES_TABLE        TRUST                      9 09-AUG-10
    NOTICES_TABLE        RTYP                       2 09-AUG-10
    NOTICES_TABLE        CHECKEDBY                  1 09-AUG-10
    NOTICES_TABLE        FEATURE_ID                21 09-AUG-10
    QOPNQ                QUANTITY                   1 28-JUL-10
    QOPNQ                NUM                       10 28-JUL-10
    QOPNQ                QOP                        1 28-JUL-10
    27 rows selected.Then i gathered statistics with estimate_percent=>null,method_opt=>'for all columns size 1'(without histogramms).
    Plan became:
    PLAN_TABLE_OUTPUT
    Plan hash value: 2184582790
    | Id  | Operation                             | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                      |                             |     1 |    91 |   969   (4)| 00:00:03 |
    |   1 |  SORT GROUP BY                        |                             |     1 |    91 |            |          |
    |*  2 |   HASH JOIN                           |                             |   689 | 62699 |   969   (4)| 00:00:03 |
    |*  3 |    HASH JOIN                          |                             |   689 | 51675 |   719   (3)| 00:00:03 |
    |*  4 |     HASH JOIN                         |                             |   392 | 24304 |   549   (2)| 00:00:02 |
    |   5 |      NESTED LOOPS                     |                             |   377 | 17342 |   479   (1)| 00:00:02 |
    |*  6 |       HASH JOIN                       |                             |   435 | 13485 |    43   (7)| 00:00:01 |
    |*  7 |        INDEX RANGE SCAN               | DISRELFLAT_UI_DISGRP_DISMBR |    12 |   180 |     3   (0)| 00:00:01 |
    |   8 |        INDEX FAST FULL SCAN           | NOTICEDISS_UI_NOTE_DIS      | 38127 |   595K|    38   (3)| 00:00:01 |
    |*  9 |       TABLE ACCESS BY INDEX ROWID     | NOTICES_TABLE               |     1 |    15 |     1   (0)| 00:00:01 |
    |* 10 |        INDEX UNIQUE SCAN              | NOTICES_TABLE_PK            |     1 |       |     0   (0)| 00:00:01 |
    |* 11 |      TABLE ACCESS FULL                | NOTICEQUANT                 | 34306 |   536K|    69   (5)| 00:00:01 |
    |  12 |     VIEW                              |                             | 79375 |  1007K|   167   (3)| 00:00:01 |
    |  13 |      SORT UNIQUE                      |                             |       |       |            |          |
    |  14 |       UNION-ALL                       |                             |       |       |            |          |
    |* 15 |        HASH JOIN                      |                             | 19811 |  1160K|    86  (11)| 00:00:01 |
    |  16 |         INDEX FAST FULL SCAN          | QUANTITIES_UI_ID_OP         | 45161 |   352K|    33   (7)| 00:00:01 |
    |* 17 |         HASH JOIN                     |                             | 19811 |  1006K|    51  (10)| 00:00:01 |
    |  18 |          TABLE ACCESS FULL            | QOPNC                       | 34214 |   434K|    33   (7)| 00:00:01 |
    |  19 |          VIEW                         |                             | 19811 |   754K|    16   (7)| 00:00:01 |
    |* 20 |           CONNECT BY WITHOUT FILTERING|                             |       |       |            |          |
    |  21 |            TABLE ACCESS FULL          | QOPNQ                       | 19811 |   193K|    16   (7)| 00:00:01 |
    |* 22 |        HASH JOIN                      |                             | 34214 |   701K|    68   (9)| 00:00:01 |
    |  23 |         TABLE ACCESS FULL             | QOPNC                       | 34214 |   434K|    33   (7)| 00:00:01 |
    |  24 |         INDEX FAST FULL SCAN          | QUANTITIES_UI_ID_OP         | 45161 |   352K|    33   (7)| 00:00:01 |
    |  25 |    TABLE ACCESS FULL                  | COMPS                       |   212K|  3320K|   244   (5)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("C"."ID"="COMP")
       3 - access("NQ"."QUANT"="ID")
       4 - access("NQ"."NOTE"="N"."ID")
       6 - access("ND"."DIS"="DR"."DISMBR")
       7 - access("DR"."DISGRP"=1080801245)
       9 - filter("N"."TYPE_ID"=2 AND "N"."TRUST">=0)
      10 - access("ND"."NOTE"="N"."ID")
      11 - filter("NQ"."LINK"=2)
      15 - access("ID"="RT")
      17 - access("QOP"="QUANTITY")
      20 - access("QUANTITY"=PRIOR "QOP")
      22 - access("ID"="QUANTITY")Now,query executes as fast as in first schema.
    Best regards,Pavel.
    Edited by: Pavel E.

  • Why init() instead of constructor

    why we are using init method instead of constructor to initialise a servlet? pls any bosy tell me

    Before a servlet can be loaded, the servlet engine must first locate its class.Once loaded, the servlet engine instantiates an instance of that servlet class. An instantiated servlet must be initialised before it is ready to receive client requests.The Servlet API provides the init() callback method for a servlet to place all its initialisation logic. Once a servlet has been instantiated the init() is invoked by the servlet engine to initialise the servlet for the first time only.

  • Why Swing

    I need to define a clear set of guidelines for when it is appropriate to use Swing over a Broswer based implementation. My experience tells me the following:
    Using Swing launched with Web Start:
    UI has richer components
    More powerful client side processing with fewer trips to the server
    Use of threads
    Asynchronous processing
    Large amounts of client side data
    Using Browser based:
    UI limited to HTML (unless you use something like Flash, but then there is a performance issue)
    Synchronous processing requiring a trip to the server on each action
    No threading
    Data is more form based
    Other thoughts?

    Java WebStart is very good for distributing an
    application.Good point. The only deployment problem WebStart has, at least as far as I know, is that it still requires the user to have a JRE installed. Unfortunately, there are still audiences that have trouble doing that on their own. And that's not considering some of the things I've read about problems with multiple JRE/JDK installations.
    The Ajax technology is a architectural nightmare;
    nice results, but ugliness under the hood.Could be, I've little experience with it. I was just pointing out the fact that a browser based client does not require syncrhonous communications.
    If I look at the results my browser gets from e.g., gmail, I'm inclined to agree that a lot of "fancy" technologies for browser-based clients quickly get messy

  • Why 0RT_C05 instead of 0PUR_C01

    Hi guys,
       Can I know what is the advantage or disadvantage of using InfoCube 0RT_C05: Goods Procurement instead of 0PUR_C01: Purchasing Data
      What I essentially need is just the informations related to Purchase Order.
      Some insights would be very much appreciated especially in which scenario would 0RT_C05 be used ?

    Hi
    0PUR_C01 is used to analyse purchasing data based on vendor and meterial. Its like Which materials and how much of each quantities are purchasing from which vendors. Whereas 0RT_C05 is based used in the Retail Industry, where Goods Pocurment data is analysed based on Vendor and Material along with Location(unlike in Purchasing cube).
    Regards
    Vj

  • T510: Why NVS3100 instead of ATI 5650 discreate graphics?

    I appreciate the lower power consumption in the NVS3100 (14 W) compared to ATI 3650 (30W), with comparable performance. But why did they not chose the new ATI 5650 with about double performance, DirectX 11 support and 15-19W power consumption? Especially since Lenovo obviously seams to have great problems with swithcable graphics after the change to NVS3100. Or is there a good reason for this choice?
    Thanks
    Sidan77
    ThinkPad T410 2522 : i7-620M : 4GB-PC8500 : 250GB 7200rpm (FDE): 14.1" HD+ 16:10 :
    NVIDIA NVS 3100, Intel WiFi Link 6300 : Win7 Pro 64 : 6Cell.

    Thanks for your replies but they don't make much sense to me.
    1. High end graphics only in the W model? HD 5650 is not really a high end card, it has good performance and low power consumption, which should be perfect for the T510. Although comparing to the W510, the HD 5650 actually does have a higher performance rating than the  with an NVIDIA FX880M card, according to: http://www.notebookcheck.net/Mobile-Graphics-Cards-Benchmark-List.844.0.html. Comparable power consumption as the FX880M in the ATI model range has a lot higher performance still. Take a look at the HD5800 model range. 
    2. High price? Again, HD 5650 is not a high end card and has started to appeared in many consumer laptops. The price should not be an issue here. I want to buy a high end business laptop and what I see is a lot better performance in consumer laptops for half the price?
    3. Bad driver support? Sure, the NVS drivers seems great. So far there has been reported flickering when dragging around windows in windows 7 in power saver mode, and switchable graphics doesn't work.
    ThinkPad T410 2522 : i7-620M : 4GB-PC8500 : 250GB 7200rpm (FDE): 14.1" HD+ 16:10 :
    NVIDIA NVS 3100, Intel WiFi Link 6300 : Win7 Pro 64 : 6Cell.

  • Why "try" instead of "install" on some apps

    How come after this latest update of the Creative Cloud Desktop app  some apps that are not installed yet on my system are saying "Try" instead of "Install". I know that Indesign and Audition (and I thought all the rest) are included in my full CC membership, so how come some of them say Try while others say Install?

    Sign in, activation, or connection errors | CS5.5 and later
    Mylenium

  • Why downgrade instead of update?

    After i "updated" the ipod software, i cannot manage my podcasts. Is there any explanations for that?

    Okay, well the first thing is for you to ignore other threads and concentrate on your problem, not theirs.
    Things appear to have changed since your first post (it was Podcasts, now it's "most of the stuff and Playlists". So one thing at a time, let's look at the Podcasts:
    Let's try and walk through some steps to ensure you hasve the correct options set:
    1. Connect your iPod to iTunes
    2. (in iTunes) click on the device>your iPod's name> Podcasts - there should be a tick in the box named *Sync Podcasts*
    3. ... underneath that what choices have you made? For example, my options are *Automatically include>all>episodes of>all podcasts.* Any other choice will mean that some or all Podcasts will not be transferred to your iPod. (We can discuss that later if you wish.)
    How did you get on?
    Now, what about "most stuff and Playlists"?
    A. switch to device>your iPod's name> Summary.
    B. Is the option *Sync only ticked songs and videos* checked (on)? - It should be
    C. now switch to the device>your iPod's name> Music.
    D. the *Sync Music* option should be ticked
    E. what choices have you made in the section under the *Sync Music* optiion? (My choice is *Entire music library* and *Include music videos.)*
    With the choices I have made, basically everything in my library is Synced to my iPod. However, if I want to remove one or two tracks, I then untick the track itself in the library. *(Library/Music?<song name> "untick")* Then Sync.
    Has any of this made things clearer for you? If not, where do you get stuck?
    Phil
    Message was edited by: the fiend

  • Why "TRY" instead of "Install" on my CC

    I have purchased the full CC

    Hi jcox6969,
    Please go to preferences and check whether the install language is selected as English: http://helpx.adobe.com/creative-cloud/kb/change-installed-language.html . If the language seems to be correct then log out and sign in back again to CC desktop.
    Regards,
    Romit Sinha

  • Why is swing so slow ? :(

    Why java don't use native code for creating UI ?
    Any application, writen in swing is SLOW ...
    compared with .NET for example...
    even well tuned examples a too slow for using.
    I like java, but this $#%ing swing kills all GUI applications.

    The sad truth is that Swing has got such a bad wrap
    that many flock to SWT thinking its the holy grail of
    Java UI development because Swing is so bad. Nothing
    could be further than the truth. SWT is great in many
    respects, but Swing is better in many respects as
    well. If done right, Swing beats SWT in most cases.
    With JDK 1.4.2 improvements are even better, and on
    Mac OS X, Apple works with Sun to build their own
    optimized JVM, so Swing is pretty darn fast, near
    native performance on Mac OS X.
    I wish there was a faster way to get the truth about
    Swing out there. One problem, a lot of developers are
    not the types to accept that they wrote crappy code
    and thus their slow Swing performance is a direct
    result of their bad coding. It's a shame really.
    Accepting that you wrote some crap code only helps you
    get better...well, unless you really do stink at
    programming, then a career change may be in order ;)Well, this about wraps up my feelings about SWT and Swing.
    The problem with many programmers is: they don't like to read.
    Unfortunately Swing is too complex to write a decent program without a concerted effort in reading at a minimum the online tutorials, but to become professional you need a good Swing book.
    Once you get the hang of Swing it is actually better than Visual Basic or MS Access. I have written code generators for MS Access and Ms SQL Server applications. But I like Swing better for many reasons. For example a VB GUI is static, while with Swing you can create a form on the fly. I can go on for a couple of pages of why Swing is so cool, but I simple want to state that statements about Swing should be based on facts, not on some hype.
    Of course Swing can be made easier. That is why Sun is building a product like Rave.
    Swing is here to stay. Within just a couple of years more and more VB programmers will be coding Swing.
    This is good for Swing for the IT industry as a whole, becuase it will mean an explosion in quality products for the consumer market.

  • AWT to SWING conversion - i am so lost!!!

    Hi,
    i am hoping somebody's expertise can help me. i am still relatively new to java and have created this class in java which has an AWT gui, that enables a user to click a "load" button, which the user can then select the jpeg they want to load and the class loads the picture in the canvas. Once i had created it i realised that i actually need to do it in SWING, but the problem is that i dont know how to convert this AWT class to a SWING based class. I have included the code below, and would really appreciate it if somebody can show me how to convert my code so that it is in SWING instead.
    Thank you for your help.
    kind regards,
    Very Confused One
    --------------------------START OF CODE [ImageDicer.java] --------------------------
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.util.*;
    public class ImageDicer extends Frame
    public static void main(String[] args)
    String fileName = "default";
    if (args.length > 0) fileName = args[0];
    new ImageDicer(fileName);
    private static final String kBanner = "ImageDicer v1.0";
    public ImageDicer(String fileName)
    super(kBanner);
    createUI();
    loadImage(fileName);
    setVisible(true);
    private Panel mControlPanel;
    private void createUI()
    setFont(new Font("Serif", Font.PLAIN, 12));
    setLayout(new BorderLayout());
    final Label statusLabel = new Label("Welcome to " + kBanner + ".");
    Button loadButton = new Button("Load...");
    loadButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    FileDialog fd = new FileDialog(ImageDicer.this);
    fd.show();
    if (fd.getFile() == null) return;
    String path = fd.getDirectory() + fd.getFile();
    loadImage(path);
    mControlPanel = new Panel();
    mControlPanel.add(loadButton);
    mControlPanel.add(statusLabel);
    add(mControlPanel, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e)
    dispose();
    System.exit(0);
    private void adjustToImageSize()
    if (!isDisplayable()) addNotify(); // Do this to get valid Insets.
    Insets insets = getInsets();
    int w = mBufferedImage.getWidth() + insets.left + insets.right;
    int h = mBufferedImage.getHeight() + insets.top + insets.bottom;
    h += mControlPanel.getPreferredSize().height;
    setSize(w, h);
    private void center()
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension d = getSize();
    int x = (screen.width - d.width) / 2;
    int y = (screen.height - d.height) / 2;
    setLocation(x, y);
    private BufferedImage mBufferedImage;
    private void loadImage(String fileName)
    Image image = Toolkit.getDefaultToolkit().getImage(fileName);
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image, 0);
    try { mt.waitForID(0); }
    catch (InterruptedException ie) { return; }
    if (mt.isErrorID(0)) return;
    mBufferedImage = new BufferedImage(image.getWidth(null),
    image.getHeight(null),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = mBufferedImage.createGraphics();
    g2.drawImage(image, null, null);
    adjustToImageSize();
    center();
    validate();
    repaint();
    setTitle(kBanner + ": " + fileName);
    public void paint(Graphics g)
    if (mBufferedImage == null) return;
    Insets insets = getInsets();
    g.drawImage(mBufferedImage, insets.left, insets.top, null);
    --------------------------END OF CODE [ImageDicer.java] --------------------------

    Thanks again for your assistance. The class manages to compile now but there seems to be a bug in the program. Everytime i run the class, the window loads, but the load button does not appear. It only appears when you click aimlessly at the bottom of the window until u luckily click on it. i cannot understand why this is happening :s
    Again i am greatful for your help.
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.*;
    import javax.imageio.ImageIO;
    import java.net.*;
    import javax.swing.filechooser.*;
    public class ImageDicer extends JFrame
    String kBanner = "ImageDicer v1.0";
    JPanel mControlPanel;
    JLabel statusLabel;
    JButton loadButton;
    public BufferedImage mBufferedImage;
    public ImageDicer(String fileName)
    { Container pane=getContentPane();
         setTitle(kBanner);
         pane.setLayout(new BorderLayout());
    statusLabel = new JLabel("Welcome to " + kBanner + ".");
    loadButton = new JButton("Load...");
    loadButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    {  JFileChooser fd = new JFileChooser();
         int returnVal=fd.showOpenDialog(ImageDicer.this);
              if(returnVal==JFileChooser.APPROVE_OPTION)
                   {if (fd.getSelectedFile() == null)
                              {return;}
                                  File file=fd.getSelectedFile();
                                  String path=(String)file.getPath();
                                  loadImage(path);
    mControlPanel = new JPanel();
         mControlPanel.add(loadButton);
         mControlPanel.add(statusLabel);
    pane.add( BorderLayout.SOUTH, mControlPanel);
    public void adjustToImageSize()
    if (!isDisplayable()) addNotify(); // Do this to get valid Insets.
    Insets insets = getInsets();
    int w = mBufferedImage.getWidth() + insets.left + insets.right;
    int h = mBufferedImage.getHeight() + insets.top + insets.bottom;
    h += mControlPanel.getPreferredSize().height;
    setSize(w, h);
    public void center()
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension d = getSize();
    int x = (screen.width - d.width) / 2;
    int y = (screen.height - d.height) / 2;
    setLocation(x, y);
    public void loadImage(String fileName)
    Image image = Toolkit.getDefaultToolkit().getImage(fileName);
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image, 0);
    try { mt.waitForID(0); }
    catch (InterruptedException ie) { return; }
    if (mt.isErrorID(0)) return;
    mBufferedImage = new BufferedImage(image.getWidth(null),
    image.getHeight(null),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = mBufferedImage.createGraphics();
    g2.drawImage(image, null, null);
    adjustToImageSize();
    center();
    validate();
    repaint();
    setTitle(kBanner + ": " + fileName);
    public void paint(Graphics g)
    if (mBufferedImage == null) return;
    Insets insets = getInsets();
    g.drawImage(mBufferedImage, insets.left, insets.top, null);
    public static void main(String[] args)
    String fileName = "default";
    if (args.length > 0) fileName = args[0];
    ImageDicer img=new ImageDicer(fileName);
    img.setSize(800,600);
    img.show();
    }

  • Javax.swing, ImageIcon question

    I'm working on a game in java which i've done most of the programming for. Now I'm trying to work on the GUI - something i've never worked for in java, and when I asked, I was told i should use swing for my GUI, which looks about right - it's turn-based and won't be particularly fancy. I want a few things listed on the window, along with a textbox, and a visual map - and it's that map which is giving me the problem. Basically, i have an 800x600 window, and starting in the top left corner i want to have a 15x15 array of 'tiles' to make up the map. These 'tiles' are 32x32 .png files, so it comes out to 480x480 which leaves room for other things. I've been looking at the tutorials on swing ( http://java.sun.com/docs/books/tutorial/uiswing/TOC.html to be specific) and this is what i came up with.
        public static void addComponentsToPane(Container pane) {
             pane.setLayout(null);
            ImageIcon icon = createImageIcon("images/Tile1.png", "grass");
            JLabel mapLabels[][] = new JLabel[15][15];
             for (int x = 0; x < 15; x++)
                  for (int y = 0; y < 15; y++){
                       mapLabels[x][y] = new JLabel(icon);
                       mapLabels[x][y].setBounds(x*32,y*32,(x+1)*32,(y+1)*32);
            for (int x = 0; x < 15; x++)
                 for (int y = 0; y < 15; y++)
                               pane.add(mapLabels[x][y]);
                    }this is the segment of code that's putting an ImageIcon array (later to be more varied than what it currently is...) on the screen. I can give the whole class if you need it, but its really not much of a departure from some of the ones in the tutorial.
    here is a screenshot of the problem i have:
    http://img.photobucket.com/albums/v682/sqpat17/tiles.png
    Basically it's that empty space i'm wondering about how to get out. I tried changing the bounds, and this worked when i got down to defining the label boundaries as multiples of 21, but not only did this not make sense (why 21 instead of 32?), it came out a little weird:
    http://img.photobucket.com/albums/v682/sqpat17/tiles2.png
    I'm thinking i need to either figure out a way to put more than one image icon on a single label, use something other than labels, or just figure out how to get rid of that empty space in some other way. Im using labels because they seem to be the most basic items i can put on a frame that hold ImageIcons. Anyways, help would be greatly appreciated :)

    You might want to consider using a LayoutManager.
    mapLabels[x][y].setBounds(x*32,y*32,(x+1)*32,(y+1)*32);This would put them back to back if the pictures were 32x32 pixels. Check to see how many pixels wide they are and see if thats right. Also, in the future, Swing questions should be posted in the Swing forum.

  • Thread problems in Swing

    I'm building I guess its like an online strategy game. On the map, when you move your mouse to within 50 of the bounds of the applet, it'll start scrolling the map at a predetermined speed.
    When working with applets/painting/threads this worked like a dream. Java was too fast for itself and I had to even slow the scrolling down.
    Now, I'm building the whole thing in swing instead. The map is technically a JLabel inside of a Container that gets loaded into the main contentPane.
    The only way I could use setLocation in my threads run method was to setLocation on the Container, not the JLabel. Odd fix to that problem. (I kept getting a null pointed exception otherwise)
    My problem is, when the mouse is in that 50 pixels, the program knows it, but it just /lags/. Horribly. I set a counter to print to the console and when the mouse enters the area it moves to like 15 (in 0.001 seconds), and stops. I move my mouse around, and a few seconds later I see 700-705, then it stops, and jumps ahead again if I move my mouse.
    So my program will now scroll the map in very small, /very/ jagged bits.
    It's not an intensive program or code. I don't see how or why the thread can't continually run it.
    My run method:
    public void run() {
              while (true) {
                   if (mouseX > 650 && mouseX <= 700)
                        moveRight = true;
                            if (moveRight == true) {
                        if (mapCurrentX + screenX < (xDimension)) {
                             mapCurrentX -= moveSpeed;
                             contentPane.setLocation(mapCurrentX, mapCurrentY);
                   try {
                        // Stop thread for 20 milliseconds
                        Thread.sleep(20);
                   catch (InterruptedException ex) {
                        // do nothing
                   Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
         }

    I got this when I ran it ^_^;; Gonna try to fix it
    Wrong Thread
    java.lang.Exception: Stack trace
         at java.lang.Thread.dumpStack(Unknown Source)
         at ThreadCheckingRepaintManager.checkThread(ThreadCheckingRepaintManager.java:13)
         at ThreadCheckingRepaintManager.addInvalidComponent(ThreadCheckingRepaintManager.java:6)
         at map.<init>(map.java:74)
         at ClientMain3.init(ClientMain3.java:12)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

  • Why are there so few printers that airprint supports?

    i am curious to find out if anyone knows why apple was so selective on printers that airprint would support. i have a hp photosmart c7280, it has wi-fi capabilities but alas is not in the "list" of printers that apple says will work with airprint. why? instead i have to rely on a 3rd party app (print magic) to do that. print magic is a good app but i would figure that apple would want to give prefference to it's "own" software rather than someone elses. why have it as an option is in ios 4.3 if it wont work with any wi-fi printer?

    Some folks have reported good results with Photosmart using the following workaround:
    http://jaxov.com/2010/11/download-airprint-installer-for-windows-7-xp-vista/

Maybe you are looking for

  • Business role in IC

    Hi experts, I have a confusion on understanding Business Roles in interation center. scenario: call center set up is there with 100 CSR's, where everyones role is same. here my confusion is Do we have to create different business role for each CSR or

  • I have a warning AY 7:36 what does this mean?

    I have a warning AY 7:36 in my doc bar what does this mean?

  • Status to Mail sent and Not sent

    Hi,     I have a list of records which contains to whom i should send a mail.Below is the screen shot and procedure which gives me the records. Now i want a stored procedure , In below screenshot if 1st record means if the mail is sent  for 1st recor

  • Error in Photo upload.. pls help

    Hello All, I have uploaded a new photo for am employee, but it is not shown after uploading in R/3 Kindly help... Thanks, Nithi

  • Capture Data - where to download?

    I would like to diagnose some recent problems I have on my Mac. Where can I get Capture Data from? I hope to help Apple diagnose the problems (they suggested to do an Archive and Install, but I don't want to go that far) Is it similar to Sysinternal'