Quick question about custom Components and Panels

Okay, so here is the situation.
I created a custom component that overrides paintComponent. All this component does is draw a diagonal line.
If I add this component directly to a JFrame it displays fine.
The issue: I made a custom JPanel that at the moment only contains this component. If I add it to the JPanel then add that to the JFrame, it only displays a dot.
Any suggestions?

Layout issue. The intermediate JPanel has a default FlowLayout manager which shows its child components at their preferredSizes. These sizes are computed by the layout manager in the process of laying out the children. When there are no children the size reported to the parent is the default size which for JPanel is (10, 10). You can change the layout manager for the intermediate panel or specify a preferredSize for the graphic component in one of two ways:
1 - use the setPreferreSize method
2 override the getPreferredSize method in the class:
class Pseudo extends Jpanel {
    protected void paintComponent(Graphics g) {
        // custom drawing...
    public Dimension getPreferredSize() {
        return new Dimension(desiredWidth, height);
}

Similar Messages

  • A quick question about WebDynpro SLD and R/3 with concurrent users

    Hello ,
    I have a very quick question about Webdynpros and SLD connecting to an R/3 system, when you configure a webdynpro to connect to an R/3 system using SLD, you configure a user name and password from the R/3  for the SLD to use. What I would like to know is when I have concurrent users of my webdynpro, how can I know what one user did in R/3 and what another user did? Is there a way for the users of the web dynpro to use their R/3 credentials so SLD can access the R/3? Like dynamically configuring the SLD for each user?
    - I would like to avoid leaving their their passwords open in the code ( configuring two variable to get the users username and password and use these variables as JCO username and password )
    Thanks Ubergeeks,
    Guy

    Hi Guy
    You will have to use Single Sign On to achieve this. In the destination you have defined to connect to R/3 , there is an option to 'useSSO' instead of userid and password. This will ensure that calls to R/3 will be with the userid that has logged into WAS. You wont need to pass any passwords because  a login ticket is generated from WAS and passed on to R/3. The userid is derived from this ticket.
    For this to happen you will have to maintain a trust relation ship between R/3 and your WAS ,there is detailed documentation of this in help files. Configuration is very straight forward and is easy to perform
    Regards
    Pran

  • Quick Question about Cisco 3560 and the Web Device Manager

    Alright, I have a quick question that I am curious about but I haven't found any information
    about it.
    When I log into my Cisco 3560 using the web portal to get to the Device Manager. Below the
    diagram of the switch, then under the Dashboard there is section called Switch
    Health, Port Utilization.
    Under the Switch Health there is Bandwidth Used, Packet Error. Those two options just sit
    at zero and do not move. The Port tilization graph is also sitting at zero.
    Is there a way to make them functional?

    Anyone notice performance increase or decrease of their HD when using the nVidia IDE SW drivers?  particularly with a 74GB Raptor?  I've also heard of burner issues when installing the IDE SW but have not used my burner yet.

  • Another question about custom JComponents and JPanels

    Okay, so new issue now. I will be researching this as best I can while I wait for a reply.
    So I made a custom Component, and added it to a custom Panel. The Panel only contains this Component.
    If in the JFrame I create a JScrollPane and add the custom panel to it, then the scrollbar works exactly right. But, if I add the custom panel to another panel, it doesn't work. It just puts a one pixel border around the panel and centers it. I'm gonna go and read all about ScrollPanes and what it uses as a basis.
    Any help will be greatly appreciated.

    import java.awt.*;
    import javax.swing.*;
    public class WDF extends JFrame
        WDF()
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setSize(500, 300);
            WaveFormPanel test = new WaveFormPanel(500, 100);
            add(test);
            setLocationRelativeTo(null);
            setVisible(true);
        public static void main(String[] args) {
            new WDF();
    class WaveFormPanel extends JPanel
        LineComponent myLine;
        public WaveFormPanel(int width, int height)
            // to ... have the scrollpane constrained
            // to be a certain size, i.e., 400 by 100
            // no matter how large the LineComponent is.
            // You can use GridBagLayout to have scrollPane
            // shown centered and at its preferredSize.
            // The default FlowLayout will also show the
            // scrollPane at its preferredSize.
            setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            myLine = new LineComponent(width, height);
            JScrollPane sPane = new JScrollPane(myLine);
            sPane.setPreferredSize(new Dimension(400, 100));
            add(sPane, gbc);
    class LineComponent extends JComponent
        int lineWidth;
        int lineHeight;
        public LineComponent(int width, int height)
            lineWidth = width;
            lineHeight = height;
            this.setPreferredSize(new Dimension(width, height));  
        @Override
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            g.drawLine(0, 0, lineWidth, lineHeight);
    }

  • Questions about Customer Service and Prepaid Phones

    Yes, I have had Straight Talk for over two years. The phone service its self was wonderful. I only came across three places within a 50 mile radios of not being able to get reception. After asking around I found out that Straight Talks service is through Verizon. Everyone I talk to says the Verizon Tower reception was the best. I have been waiting a total of 22 days for Straight Talk to send my replacement for my broken phone. I have had it and I am going to sell the phone on Ebay when I receive it. My service with Straight Talk ends in four days and I am really considering Verizon.. Wanting to do this over the weekend. I know if I purchase a phone from Verizon directly it will be shipped overnight.
    The main thing I want to know is if Verizon has a Customer Call Center in the United States? Where I can speak to someone that speaks "Fluent" English and actually cares if I get good service or not.
    I am older and I like basics with no change. So, these are the features I want on my new phone.
    A phone with a 3 megapix are larger camera with video.
    A phone with a touchscreen and a query keyboard.
    I want a speak to text feature. The last phone had it but I have been told that a app can be put on a phone to do it if it doesn't have it..
    I haven't never had any apps downloaded on my phone but still want options for some.
    A phone that has GPS.
    These are the main features I have got to have. Nothing else matters. Can anybody help a elderly old man find a basic phone with these features?
    I would greatly appreciate any input from Verizon Users about Verizon's Customer Service Department and any suggestions for a good phone under $50. Of course I am not looking for necessarily a new phone with a lot of extras. Thanks and have a "Wonderful and Blessed Day". Chris

    The docs haven't been moved over to the 8.1 docsite, but the 7.0 docs
    for campaigns are still pretty much valid in 8.1. Look at:
    http://e-docs.bea.com/wlp/docs70/dev/cmpaign.htm#998197
    for more information.
    Basic answers:
    1. You can't from a campaign. It will always batch emails in the database.
    2. Use the bea/weblogic81/portal/bin/mainmanager.bat|sh script, which
    uses the com.bea.p13n.mail.MailManager command-line java class (JavaDoc
    at http://e-docs.bea.com/wlp/docs81/javadoc/index.html). This can be
    invoked from cron or at for regular email delivery. Also, the emails are
    deposited in the MAIL_* tables
    (http://e-docs.bea.com/wlp/docs81/db/4Schemas.html#1064602), so you
    could implement a delivery system from that as well.
    3. There are no parameters since the email delivery is invoked from a
    command-line process.
    Greg
    surfboy wrote:
    1.How to disable batch mode email in portal 8.1 Mail Service using
    Campaign?
    2.For batch mode email, when will it deliver?
    3.Where can I admin those parameter besides the fields mapping in
    portal Admin->Campaign Server and Mail Service?

  • Two quick questions about the project and timing panes

    1) Is there a hotkey for toggling between the project and timing panes?
    I can't seem to find this anywhere. I know F5 and F6 open and close them, but I'd like to be able to simply activate then without having to click on them. I'd like to be able to simply toggle between them and navigate using the arrow keys
    2) Is there a way to lock together the project and timing views so that when you open a group in one that group is also opened in the other?

    Sure, play/stop SHOULD work, but it doesn't always. And the up/down arrows only work to move layers in some instances. Try this. In a normal project, select a layer in either the layers pane or the canvas. Use the up/down arrows and you'll find Motion cycles between layers. Now close the layers pane (F5) and open it again. Now try to use the up/down arrows. It no longer cycles on my machine (and probably yours).
    In fact, Motion 4 broke a LOT of the keyboard shortcuts that used to work seemlessly in Motion 3.
    For example: I create a text object and start typing my text. About 30 percent of the time hitting the spacebar while typing text will cause playback to start. Pure annoyance.
    I used to be able to Hit HOME and END to go to the start and end of the project when the layer's pane is active, now I can't.
    About 25 percent of the time when I'm in the layers pane and I hit spacebar, instead of playing the project, I turn off the layer that was currently selected.
    Those are just a few of my pet peeves. There are definitely some real issues with shortcuts in Motion 4.
    Andy

  • Quick question about mobile sites and publishing.

    I currently have a desktop site at fabhollie.com
    I would like to start designing a phone and tablet site. My question is can I publish only the desktop site rather than all three? I would like to be able to work on the mobile site without publishing them until I have completed them. Some of the content on my requires me to update it weekly. Is there any way I could make these changes on my desktop site and publish them without publishing the unfinished phone and table pages? Thanks.

    You certainly can! ;-)
    Go into your site Properties. Select Mobile on the left and uncheck the redirect button down on the lower right. This will still publish the mobile site to the live server so you can test it but it won't automatically redirect until  you check that box again.
    It is a feature designed for exactly what you want to do.

  • Quick question about PHP sessions and Air app

    Could someone clear this up for me?
    My air app makes html requests to php scripts, php login, search etc. I've been advised to use sessions in the php scripts to ensure each request to a script is done by a logged in user.
    So is the session identifier stored automatically by air somewhere, similar to a cookie in a browser?

    4.4.1 is indeed the version of php in 10.4.6, but it's also the version of php that's running on my 10.3.9 server. You can execute php -v on your server to see which version you've got, but it seems unlikely that it's a version other than 4.4.1 if you haven't updated it yourself. Are there security updates you haven't applied?

  • Quick question about reinstalling Lion and iLife

    Hi,
    I have a MacBook Pro mid 2010.
    If I reinstall Lion, I obviously need the "Applications Install DVD" to install iLife. This should work even if the DVD is for Snow Leopard that came with my Mac, right?
    Just to make sure...
    V-M

    This is much simpler.
    If you have the System Restore disks that came with your Mac then yes, you do have the iLife apps on them.
    Yes you can install the iLife apps without installing the whole OS. Just opt to 'Install Bundled Applications only'
    Regards
    TD

  • A few questions about the ka790gx and dka790gx

    i have a few questions about the ka790gx and dka790gx , how much better is the dka790gx compaired to the ka790gx ? . how much difference does the ACC function make to overclocking etc , i plan on getting a phenom II 940BE or 720BE . i already have the ka790gx so would it be worth building another system using the dka790gx mobo , or should i keep what i already have and just change the cpu ?

    It's largely irrelevant what other boards had VRM issues other than the KA790GX - the fact is it died at stock settings. Since there is little cost difference between the more robust DKA790GX (or Platinum if you really need 1394) why bother with the proven weakling? There are other examples around of the KA not having a robust power section.  There's no way I would use even a 95W TDP CPU in the KA and absolutely not O/C.....!
    As for the credentials of Custom PC, I have generally found their reviews accurate and balanced, and echo my own findings where applicable. If a little too infrequent.
    The fact that the KA has such a huge VRM heatsink leads me to my other comments on the Forum, particularly regarding the "fudge" aspect:
    """Henry is spot on - the notion that adding a heatsink to the top of the D2PAK or whatever MOSFETS is effective is virtually worthless. The device's die thermal junction is the tab on the device back - which is always against the PCB pad. The majority of heat is therefore dissipated in to the board, and the fact that the epoxy plastic encapsulation gets hot is simply due to the inability of the heat to be conducted away from the device die via the tab. Not sure when Epoxy become an effective conductor of heat.... Good practice is to increase the size of the PCB pad (or "land" in American) such that the enlarged PCB copper area acts as an adequate heatsink. This is still not as effective as clamping a power device tab to an actual piece of ali or copper, but since the devices used are SMD devices, this is not possible. However, the surface area required to provide sufficient PCB copper area to act as a heatsink for several devices isn't available in the current motherboard layouts. Where industrial SBC designs differ in this respect is to place the VRM MOSFETs on the back of the PCB on very enlarged PCB pads - where real estate for components is not an issue.
    Gigabyte's UD3 2oz copper mainboards sound like a good idea, on the face of it. However, without knowing how they have connected the device tabs to where and what remains a mystery. I suspect it is more hype than solution, although there will be some positive effect. From an electrical perspective, having lower resistance connecting whatever to whatever (probably just a 0V plane) is no bad thing.
    The way the likes of ASUS sort of get round the problem is to increase the sheer number of MOSFET devices and effectively spread the heat dissipation over a larger physical area. This works to a degree, there is the same amount of heat being dissipated, but over several more square inches. The other advantage of this is that each leg of the VRM circuit passes less current and therefore localised heat is reduced. Remember that as well as absolute peak operating temperature causing reduced component life, thermal cycling stresses the mechanical aspects of components (die wire bonds for example) as well as the solder joints on the board. Keeping components at a relatively constant temperature, even if this is high (but within operating temperature limits), is a means of promoting longevity.
    For myself, the first thing I do with a seperate VRM heatsink is take it off and use a quiet fan to blow air on to the VRM area of the PCB - this is where the heat is. This has the added benefit of actively cooling the inductors and capacitors too....
    Cooling the epoxy component body is a fudge. If the epoxy (and thus any heatsink plonked on top of it) is running at 60C, the component die is way above that.....
    It's better than nothing, but only just."""

  • Hi, I have quick question about use of USEBEAN tag in SP2. When I specify a scope of SESSION for the java bean, it does not keep the values that I set for variable in the bean persistent.Thanks,Sonny

     

    Make sure that your bean is implementing the serializable interface and that
    you are accessing the bean from the session with the same name.
    Bryan
    "Sandeep Suri" <[email protected]> wrote in message
    news:[email protected]..
    Hi, I have quick question about use of USEBEAN tag in SP2. When I
    specify a scope of SESSION for the java bean, it does not keep the
    values that I set for variable in the bean persistent.Thanks,Sonny
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • QUICK QUESTION ABOUT PORTS

    Hi, I have a quick question about port forwarding/mapping. My question, lets say I am running MSN messenger, who's ports are 6880-6900. But lets say I am running a torrent application or something else that requires those ports. If both applications were running at the same time, would this cause interference with them on the same ports or now. Thanks
    Nathan

    Normally, only one application can listen to a specific port number at a time. If MSN is grabbing those 21 ports then your torrent app won't be able to run.
    However, most apps don't work that way - even if they use multiple ports, they don't use them all at the same time, so MSN might use 6880 when it starts up, leaving the others open for other applications to use if needed.
    Only experimentation will answer that one.

  • Quick question regarding best practice and dedicating NIC's for traffic seperation.

    Hi all,
    I have a quick question regarding best practice and dedicating NIC's for traffic seperation for FT, NFS, ISCSI, VM traffic etc.  I get that its best practice to try and separate traffic where you can and especially for things like FT however I just wondered if there was a preferred method to achieving this.  What I mean is ...
    -     Is it OK to have everything on one switch but set each respective portgroup to having a primary and failover NIC i.e FT, ISCSI and all the others failover (this would sort of give you a backup in situations where you have limited physical NICs.
    -    Or should I always aim to separate things entirely with their own respective NICs and their own respective switches?
    During the VCAP exam for example (not knowing in advance how many physical NIC's will be available to me) how would I know which stuff I should segregate on its own separate switch?  Is there some sort of ranking order of priority /importance?  FT for example I would rather not stick on its own dedicated switch if I could only afford to give it a single NICs since this to me seems like a failover risk.

    I know the answer to this probably depends on however many physical NICs you have at your disposal however I wondered if there are any golden 100% rules for example FT must absolutely be on its own switch with its own NICs even at the expence of reduced resiliency should the absolute worst happen?  Obviously I know its also best practice to seperate NICs by vender and hosts by chassis and switch etc 

  • Quick question about Quicktime media keys.......

    I had a question about encoding video and media keys. It seems to me that the only codec that allows you to encode it with a media key is Sorenson (Sorenson 3 I think). Why are they the only ones that are enabling that in their codecs? Is it kind of a dying technology or practice? I've experimented with Sorenson 3 and Sorenson Squeeze trials and, even though it looks ok, it simply doesn't stack up to others like Apple's H.264 or open-source x264 or even Xvid. I guess I wish there were a way to be able to use media key options with all the new H.264 codecs. Is it possible to do that, either with Xcode or AppleScript? Any help would be greatly appreciated!!

    QuickTime has supported 'media keys" since version 3 but you can only add them using the third party software.
    You would be better served by contacting Sorenson and asking them about their support for newer codecs.

  • Question About Color's and Gradients

    Hi all,
    I have a question about color swatches and gradients.
    I am curious to know, if I have 2 color swatches that I make into a gradient color, is it posible to change the tint of each indivdual color in that gradient and have that applied to the gradient without having to adjust the gradients opacity.
    The reason that I'm asking this is because in creating a project I found that the colors that I chose for to make my gradient from my swatches were to dark, and while I can adjust each one's tint to my liking (if the object they were applied to was going to be a solid color) but that doesn't seem to apply to the overall gradient.
    I hope that makes sense, I know that this was something that was able to be accomplished in quark and was wondering if I can do something similar.

    If you double click your gradient swatch (after adding it to the swatches)
    Then click a colour stop in the gradient, and then change the drop down menu to CMYK (or rgb)
    And you can alter the percentages there. It's not much use for spot colours but it's a start.
    But making tint swatches would be a good start anyway.
    At least then when you double click the gradient (in the swatches) to edit it you can choose from CMYK, RGB, LAB, or Swatches and adjust each colour stop to your liking.

Maybe you are looking for

  • Photoshop or Fireworks for Web Logos?

    Hi, I just recently designed a logo for my friend Don Demaise's website: http://www.landcreationsnj.com I used Fireworks for the logo. Would Photoshop be a better choice for web logos? Bob

  • CATT Mode in BDC Recording

    Hi Friends What is the Use of CATT MODE in recording parameters of  SHDB Recording . Can u pls give some valuable information Regards Krishnan R.

  • Icxr12mi.sql fails on ORA-00001

    Dear All, When applying patch 6678700 to UPGRADE FROM 11.5.10.2 TO 12.1.1, it was failed on icxr12mi.sql and showed following error: sqlplus -s APPS/***** @/erpapfs/erpprod/apps/apps_st/appl/icx/12.0.0/patch/115/sql/icxr12mi.sql &un_inv &batchsize 4

  • Can Premiere Pro resume when computer sleeps in middle of rendering?

    My computer core i7 64 bit 1.6 CPU (boosts up to 2.5) 6 gigs ram My footage source: 1920x1080 Output: 720x480 Time of footage 54 min File Size 2.5 gigs Render time When I had it set to Qualtiy 5.0, Bitrate 5 -7, VBR 2 pass, and checked Max. Render qu

  • HR action sync.

    hi,, There are few actions configured in HR system for example Going on Leave and Return from Leave, plus there are few more actions which are configured as per requirement. There are other actions like going on emergency leave and return from emerge