Qt heavy weight component
Hi guys,
Im using the QT java api and have hit some problems with their AWT video window component. The reason I'm posting here rather than the QT forums is that I believe this problem is common to all heavy weight components in Java.
Ok, the QT api offers a factory method for creating what they call QTComponent (awt heavy weight component - extends java.awt.component) which I add to a dedicated JPanel.
I need to be able to set the visibility of the video window so I do;
parent_panel.setVisible(value)
parent_panel.repaint();
parent_panel.invalidate();
parent_panel.validate();
which sets the parent JPanel visibility to hidden but does not hide the child video window. (note: this is called from the event dispatch thread).
I have tried validate, invalidate, repaint (you name it), on both the parent JPanel and the java.awt.component itself, but this still doesn't fix the problem.
One thing to note is that if I resize or minimize then maximize the container JFrame the video window disappears. So i'm guessing the handlers for these events execute routines I need to in my 'setvisible' method.
If anyone could help that would be great.
Many thanks,
Alex
Athlon1600 wrote:
that heavy-weight component is JDIC web browser. It's the only cross-platform browser I know and it's one of the main controls in my GUI. can't change thatCan't help you there.
JInternalFrame descends from JComponent? yes?Yep. So it's lightweight.
Well, I'm not smart enough yet to mix lightweight and heavyweight components, but fortunately Google is: [Mixing Heavy and Light Components|http://java.sun.com/products/jfc/tsc/articles/mixing/]
~{color:gray}the first hit by the way{color}~
Similar Messages
-
Quicktime heavy weight components
Hi guys,
Im using the QT java api and have hit some problems with their AWT video window component. The reason I'm posting here rather than the QT forums is that I believe this problem is common to all heavy weight components in Java.
Ok, the QT api offers a factory method for creating what they call QTComponent (awt heavy weight component - extends java.awt.component) which I add to a dedicated JPanel.
I need to be able to set the visibility of the video window so I do;
parent_panel.setVisible(value)
parent_panel.repaint();
parent_panel.invalidate();
parent_panel.validate();
which sets the parent JPanel visibility to hidden but does not hide the child video window. (note: this is called from the event dispatch thread).
I have tried validate, invalidate, repaint (you name it), on both the parent JPanel and the java.awt.component itself, but this still doesn't fix the problem.
One thing to note is that if I resize or minimize then maximize the container JFrame the video window disappears. So i'm guessing the handlers for these events execute routines I need to in my 'setvisible' method.
If anyone could help that would be great.
Many thanks,
AlexLightweight components are components whose printed
sources weigh less than 200 grams.Is a paper and a print face required? -
hi
i have on doubt in swing... awt are heavy weight && swing are light weight .awt are system dependedent ....iam right..
if right System dependent in this sence java is plaftform independent
so how is it possible..
pls give me details
regards
kedarLight weight components: To draw the components the jvm takes the os routine.
Heavy weight components: To draw the components the JVM takes its own routines.
You can check this. If you draw the awt component in one os it gives the different layout in other os. But this is not in the case of swing.This is the main difference . That's why the main components in big project are done in swing.
if in doubt please ask?
javasans -
Why the AWT components are called heavy-weight and SWING as light-weight?
Why the AWT components are called heavy-weight and SWING as light-weight?.
Building our own components means overhead on JVM. hence in what sence the SWING components are called light weight.?
I know that the Swing componets are the components which are not going to depend upon peer classes and render, OS independent LOOK n FEEL.
Thanks,
Sanath KumarAll extensions of Component are considered lightweight since, as you point out, they don't have their own dedicated native peer.
Essentially a lightweight component only has a canvas on which to draw itself and some means of receiving events from the system. In fact, there is no need to have one of these "canvas" and "event" objects for each component - the parent component can manage these abilities on behalf of its children. Eventually you end up with only top-level components needing to be heavyweight in order to communicate with the windowing system.
A lightweight component therefore has the minimal dependency on the underlying windowing system giving you maximum cross-platform flexibility.
It is usually true that lightweight => slower and heavyweight => faster since it is reasonable to assume that native peers will be optimal for the windowing system. However, that's not the point of the lightweight/heavyweight distinction.
Hope this helps. -
Forcing PopupFactory to return a heavy weight popup
Hi, in my application I want to display a Popup over the top of a Canvas that is within a JPanel. The way I am trying to achieve this is:
PopupFactory popupFactory = PopupFactory.getSharedInstance();
Popup tipWindow = popupFactory.getPopup(tipComp, tip, theLocation.x, theLocation.y);
tipWindow.show();The variable tipComp is a heavy weight Canvas, and the variable tip is a subclass of JToolTip we are using to provide extra functionality.
Using this code the Canvas is obscuring the Popup, as the Popup returned is light weight. Is there any way to force PopupFactory to return a heavy weight popup?I did consider this but unfortunately it is not possible. The software has been developed over a long period of time and is very large. It would not be possible to have anything other than a Canvas (we actually have extended Canvas to provide extra functionality). Is there any other way to solve this problem?
Thanks -
Fixing heavy weight Canvas problem
I am new at posting in the forums so let me apologize ahead of time if I am not clear enough. I first (incorrectly) posted this topic in the "Java Programming" forum and was led to this forum instead.
I am using NIH's open source "Image Processing and Analysis" libraries, ImageJ, in a program that I am creating. Basically I have a JFrame that is divided into 4 sections via nested JSplitPanes. Each of the 4 sections (top right, top left, bottom right, bottom left) contain a JScrollPane to which I have added a JPanel. I would like to display an image of type ImagePlus (an ImageJ class that extends java.lang.Object) in 3 of these sections.
Each ImagePlus is currently contained in a subclass of an ImageCanvas (another ImageJ class) which extends java.awt.Canvas. This ImageCanvas is then added to the corresponding JPanel. When the JScrollPanes are resized so that they are smaller than the ImagePlus, the image extends outside (and appears over top) the JScrollPane.
In another forum posting I was reading, it was said that instead of extending Canvas you should extend JPanel so that you do not mix AWT and Swing components, which I understand. However, would it be possible to add an ImagePlus to a JPanel since the ImagePlus does not extend java.awt.Component?
If not, could anyone suggest some other way of displaying my ImagePlus in a light weight component?
Thanks for any assistance!You where given a suggestion in your other posting two days ago.
You where given the exact same suggestion as was given here. In fact you where also given the same to link to the article on mixing components.
Where in the other posting did you comment that the suggestion given did or didn't work??? If you ask a question the least you can do is comment on whether the suggestion was helpfull or not.
So quit multi-posting question and keep the conversation in on posting so everybodyy knows what has already been suggested and so people don't waste their time making the same suggestions. -
Hi,
I want to create my own Light Weight component and I search informations about it.
If anyone know a good cup of ressources you can write here.
Thanks.Do yer own research, lame-brain.
-
Laptop monitor crashed due to heavy weight on it
Sir,
I have hp pavilion n15-004TX, bought 6 months ago. I have 1+2 years extended factory warranty.And my laptop screen has crashed due to fall of heavy weight on it. I was wondering if this comes under factory warranty or not?
Waiting for your valuable response.This Forum is not a link to HP Warranty. We are volunteer end users like you. I think the Care Pack may or may not include Accidental Damage coverage. It is very expensive and you have to buy it as an add-on. Your best bet is to call HP. If it is not covered we can help you find a screen and show you how to replace it. How much was damaged? Do you just need the screen or also some platic chassis parts? Screens cost less than you probably think (under $100 in most cases) and the replacement is not real hard.
-
What is lightweight process and heavy weight process
please can any one send the difference between lightweight process and heavy weight process .... and why thread are called lightwieght process
shankrocks wrote:
please can any one send the difference between lightweight process and heavy weight process .... and why thread are called lightwieght processProcess and thread are often used interchangeably (even though process also is used in a wider meaning). In Java a lightweight thread is also called a green thread.
[http://en.wikipedia.org/wiki/Green_threads]
So when programming in Java you're going to be using lightweight threads (unless you somehow bypass the JVM and start OS threads directly).
More generally heavyweight usually refers to something that supplied by the OS. You have the same is Swing/AWT where Swing widgets are called lightweight because they're drawn by Java while AWT widgets are called heayweight because they're drawn by the OS. -
Problems with embedded font with medium or heavy weight
Hey guys,
I'm switching a current Project from Flashbuilder Beta2 to the Flashbuilder final release.
I have a big problem concerning embedded fonts. The fonts I have to use are Futura Com Medium & Futura Com Heavy.
Here's some of my code:
@font-face
src: url("assets/fonts/FuturaCom-Medium.ttf");
font-weight: normal;
fontFamily: myFuturaMedium;
advancedAntiAliasing: true;
embedAsCff: false;
.myDatagrid{
fontFamily: myFuturaMedium;
color: #ff0000;
this worked well in beta2, but I'm not able to get the embedded Font working in the datagrid with the Flashbuilder final release.
Any help on using embedded fonts in a mx|Datagrid is highly aprechiated.
CheersHey guys,
I'm switching a current Project from Flashbuilder Beta2 to the Flashbuilder final release.
I have a big problem concerning embedded fonts. The fonts I have to use are Futura Com Medium & Futura Com Heavy.
Here's some of my code:
@font-face
src: url("assets/fonts/FuturaCom-Medium.ttf");
font-weight: normal;
fontFamily: myFuturaMedium;
advancedAntiAliasing: true;
embedAsCff: false;
.myDatagrid{
fontFamily: myFuturaMedium;
color: #ff0000;
this worked well in beta2, but I'm not able to get the embedded Font working in the datagrid with the Flashbuilder final release.
Any help on using embedded fonts in a mx|Datagrid is highly aprechiated.
Cheers -
Robohelp 9 search: heavier weight with multiple keywords?
We are working with the new search engine (moved from 7 to 9) and are having some issues with the way that our users are used to searching. One thing was came up was the question of whether a single keyword added multiple times to a topic would bring it a higher weight in the Robohelp 9 search ranking. Does anyone know if it will disregard multiple instances of the same word in the Keywords in the Topic Properties or if we can use that to stack the deck?
Hi there
One way to "stack the deck" so to speak is to ensure the keyword is used in the Topic Title. Aside from that, ensure it is also used in the Keywords field of the topic as well as in heading levels. For example, a keyword in a Heading 3 will be trumped by the same keyword in a Heading 1. And that is trumped by the keyword in the Topic Title.
Cheers... Rick
Helpful and Handy Links
RoboHelp Wish Form/Bug Reporting Form
Begin learning RoboHelp HTML 7, 8 or 9 within the day!
Adobe Certified RoboHelp HTML Training
SorcerStone Blog
RoboHelp eBooks -
How can i improve a heavy weight query
i previously posted a question about a query someone else has written and i am now looking to rewrite to improve its timing.
this is the old query :
SELECT 0, 0, 0, 0, SUM(CAST(allowedHours AS number(20,0))) FROM tablex WHERE (forecastCode = 83 AND filesetId in (SELECT VAL FROM tabley WHERE QUERYID = '38ab814a7c465cf8_3afa60db_1134ddf8f6e_-7ff9' AND DATATYPE = 1) AND taskCode in (SELECT VAL FROM tabley WHERE QUERYID = '38ab814a7c465cf8_3afa60db_1134ddf8f6e_-7ff9' AND DATATYPE = 2) AND roleId in (SELECT VAL FROM tabley WHERE QUERYID = '38ab814a7c465cf8_3afa60db_1134ddf8f6e_-7ff9' AND DATATYPE = 3) AND ((weekstart BETWEEN 39171 AND 39534)))
which i have rewritten so far as :
SELECT 0, 0, 0, 0, SUM(CAST(TB1.ALLOWEDHOURS AS number(20,0))) "BEST RESULT" FROM TABLEOWNER.TABLEX TB1 WHERE TB1.FORECASTCODE = 83 AND EXISTS (SELECT TBQ.VAL FROM TABLEOWNER.TABLEY TBQ WHERE TBQ.QUERYID = 'v4eaeac2_-17d28fb6_1134e59b62b_-3xx9' AND TBQ.DATATYPE = 2 AND TBQ.VAL= TB1.TASKCODE) AND EXISTS ( SELECT TBQX.VAL FROM TABLEOWNER.TABLEY TBQX WHERE TBQX.QUERYID = 'v4eaeac2_-17d28fb6_1134e59b62b_-3xx9' AND TBQX.DATATYPE = 1 AND TBQX.VAL = TB1.FILESETID ) AND EXISTS (SELECT TBQY.VAL FROM TABLEOWNER.TABLEY TBQY WHERE TBQY.QUERYID = 'v4eaeac2_-17d28fb6_1134e59b62b_-3xx9' AND TBQY.DATATYPE = 3 AND TBQY.VAL = TB1.ROLEID) AND (TB1.WEEKSTART BETWEEN '39171' AND '39534') ;
this has given me a 70% reduction in the elapsed time of the query.
for the record :
TABLEX has 31,536,939 records, of which 15,001,043 are affected by the query.
and
TABLEY has 7,539 records.
in addition i created an index for the large table.
CREATE INDEX "TABLEOWNER"."TABLEX_IDX" ON "TABLEOWNER"."TABLEX" (FORECASTCODE, TASKCODE, FILESETID, ROLEID, WEEKSTART, ALLOWEDHOURS) TABLESPACE "BIGTABLES" PCTFREE 0 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 2048M NEXT 1024M BUFFER_POOL DEFAULT) LOGGING
the net result in the explain plan is :
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=13879 Card=1 Bytes=162)
1 0 SORT (AGGREGATE)
2 1 HASH JOIN (RIGHT SEMI) (Cost=13879 Card=348592 Bytes=56471904)
3 2 TABLE ACCESS (FULL) OF 'TABLEY' (TABLE) (Cost=21 Card=503 Bytes=23641)
4 2 HASH JOIN (RIGHT SEMI) (Cost=13851 Card=352423 Bytes=40528645)
5 4 TABLE ACCESS (FULL) OF 'TABLEY' (TABLE) (Cost=21 Card=503 Bytes=23641)
6 4 HASH JOIN (Cost=13807 Card=1276364 Bytes=86792752)
7 6 SORT (UNIQUE) (Cost=21 Card=503 Bytes=23641)
8 7 TABLE ACCESS (FULL) OF 'TABLEY' (TABLE) (Cost=21 Card=503 Bytes=23641)
9 6 INDEX (FAST FULL SCAN) OF 'TABLEX' (INDEX) (Cost=13523 Card=15182009 Bytes=318822189)
Statistics
64 recursive calls
0 db block gets
58781 consistent gets
1713 physical reads
0 redo size
643 bytes sent via SQL*Net to client
504 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
MY QUESTION. is there anything else i can do to optimize this query. before you say, add an index for TABLEY, don't because this was not as fast as the full table scan, using an index only gave 22% improvement.
finally, i also analyzed the tables before hand.
many thanks in advancePlease post the explain plan and tkprof as described [url http://forums.oracle.com/forums/thread.jspa?threadID=501834&tstart=0]here. Also please make sure you use the tags [pre] and [/pre]!.
Regards,
Rob. -
is there a way to convert heavy weight component to light weight component?
example Component to JComponentlol... what do u mean.... what i meant was eg..
Label xx = new Label;
but i want to "change" xx of type Label to JLabel -
How to reduce the weight of a combo box in a jsp
hi friends,
i have developed a jsp form in which i have placed some combo box and i am using ajax concept for loading the details for a field just above the combo box.
my problem is that when the ajax loads the records in the form it comes above the combo box .there,the combo box is coming above the ajax listings and hides the records displayed by ajax.can anybody help me to solve this problem of combo box.<td class="label">Cash bank general</td><td>
<html:select property="accledgeractionform.ledgercbg" styleId="cmbcbg" styleClass="inputbox" style=" width : 130px" tabindex="14" onfocus="setStatusMessage('Select cash bank general')" >
<html:option value="" styleId="cmbCashBankGeneral">
</html:option>
<html:option value="C">Cash</html:option>
<html:option value="B">Bank</html:option>
<html:option value="G">General</html:option>
like this i have created the combo box.
but it is displayed above the results displayed by the ajax.
i thought that since combo box is a heavy weight component its weight must be reduced.help me about that -
Hi all,
I have a problem with JSplitPane, I use it with JPanel as right component and an AWT component as left Component, so when I move The Divider of the JSplitPane it hides under the AWT component not on the top of it.
I know that result from problem of heavy weight component and light weight component .. but my question is there any work arround I can do to make the Divider appear on the top of the AWT component??
Thanks,You've been given an idea: DO NOT MIX AWT and SWING Components.
Why do you need to mix them? What is the AWT component?
If it's something you wrote yourself, then you can change it. If it's not, decompile it and change it. Anyone who can't provide a Swing version of their stuff at this point is out of business and shouldn't care what you do with it.
If it's some Canvas subclass, you can make it a Swing component by changing 2 lines: extends JPanel instead of Canvas and change paint() to paintComponent().
is there any work arround I can do to make the Divider appear on the
top of the AWT component??definitely not, unless you make the divider a heavyweight component somehow.
Maybe you are looking for
-
Is it possible to call a locally installed ibook from a hyperlink? What about to a bookmarked page? I have 2 questions.. 1. Can I send a link via email that when launched will open an ibook that has already been downloaded to the bookshelf? 2. If que
-
NB305-N440BL getting 0a-0224-0000 file transfer error message using USB Thumbdrive
Doing total out of the box restore. First off, Toshiba, in their infinite wisdom sends a DVD Rom to you when you order a Recovery Media for a Netbook which has NO DVDROM. I had to replace the HD after an accident and it is unreadable as a harddrive
-
In Select query how to fetch values through multiple parameters where conditon
Dear Experts, I have one table(T) with 4 fields: f1, f2, f3, f4. In that based on f2, f3, f4 and parameter condition( f2 values) how to fetch f1 values. I have attached screen shot. What is the where condition in select query? DATA: it_T type standar
-
Array to grid works but need some help. Please help the beginner...
Hi, I'm very green at this... I've been trying to display a two-dimmensional array on a dataGrid and finally found some code that I was able to modify to my needs. However couple things I don't understand. 1. Do I need the <s:itemRenderer>...</s:item
-
I changed over from an iPad 2 to iPad Air through the use of iCloud. My Facebook app is listed on my settings page as if the app exists but their is no icon to tap to enter the app. It will not allow me to delete it off the settings page but I can al