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);
}

Similar Messages

  • 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?

  • 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);
    }

  • Yet another question about NAS Drives and Sharing.

    Please can someone help me as this is massively frustrating.
    OK, so I have 2 computers (A desktop and a laptop).
    Originally my iTunes library was on my desktop but it was getting to big so I bought a NAS. Following the instructions you provided elsewhere I and moved my 20,000  songs / artwork / playlists etc successfully to the NAS, I changed my library in Edit > Preferences > Advanced to L:\Music\Music. When I go onto iTunes from my Desktop everything is from the NAS is displayed in Library > Music and works perfectly.
    The problem I have is when I try to access the NAS from the laptop. I have no music stored on the C: drive of the laptop so figured that I should have no problems with just mapping the NAS to the L: drive like I did above and following the same steps as above I should see all the songs in the the Music Library but that is NOT happening. I have changed my library in Edit > Preferences > Advanced to L:\Music\Music but get nothing. Why have I got no music in my library?
    I'm happy for a solution to involve having the NAS as a Shared drive but one that doesn't entail always having to have the Desktop on and iTunes on.
    I can access the music on my NAS via Home Sharing but everytime I turn my desktop off the music library disappears (but I'd expect this and, anyway I don't want this to be a workaround).
    I can get to this music fine via Windows Media, I can even stream it via Rockplayer on my HTC phone.
    Am I doing something dumb? Also anything that you can help in terms of the best settings to have for sharing / NAS storage would be great as well.
    I'm running the latest version of iTunes (10.2.*) on both machines.
    Thanks in advance.

    Hi(Bonjour)!
    What is the format recorded by this camera?
    How did you capture/ingest your video material in FCE?
    What was your sequence format in timeline?
    How did you export your sequence (specify exact steps, menus and command)?
    What was your iDVD project settings?
    What was the iDVD quality setting?
    Did you monitor your DVD on computer screen or TV set?
    Michel Boissonneault

  • ANOTHER Question about my iMac G3. Mac OS X and RAM

    Hey, I have ANOTHER question about my iMac G3.
    I know that I'm supposed to have the latest firmware updates for my iMac G3 running OS 8.1, which I do, but I read some where these firmware updates could only be updated if you're running OS 9.2. Yet when I run the firmware updater, it says my firmware is up to date. I just wanted to make sure this was correct because I just ordered an OS X 10.2 CD today, and I don't want my mac to be "dead" when I install it.
    My next question is how much RAM can my mac hold. It's an iMac G3 with a 233 mhz processor, if that makes a differemce.
    Again, thanks to the people who have helped me with my first Mac.

    hi there--
    unfortunately you require system 9.1 or 9.2 for the required firmware update 1.2 for your computer http://docs.info.apple.com/article.html?artnum=86117. so you'll have to install that if you want to install 10.2. it may work for you for a little while, but then you could possibly lose all your information. so i wouldn't advise attempting installing 10.2 without the correct firmware. [ : ) ]

  • 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."""

  • Another question about gmail

    I just posted a question about adding gmail and it was answered.  Now, I have another question,  I added the new gmail account.  It shows in the mail preferences under accounts.  Incoming mail addressed to gmail comes to the Archive Box. But I still can't send mail by gmail because in the drop down menu on the email it only lists my other two accounts.  Gmail is not an option.  I highlighted gmail in the account list and it showed that as the account in use.  But, still there was no gmail option on the email form in the sender box.  How do I fix that?

    You need to look at and read over these very carefully.
    http://support.apple.com/kb/TS3276
    The link above is about sending issues.  The one below is about setting up or confiquring new e-mail.
    http://support.apple.com/kb/HT1277
    Good Luck to you and welcome to the Discussions.
    Don

  • Yet another question about super raid - GS70

    Yes, another question about Super Raid...I recently picked up the cheapest model of the GS70 on newegg which comes with 1 mSata SSD...just a mediocre one if I remember reading correctly.  I'm interested in using MSI's Super Raid once my warranty is over with and have been reading a couple posts here:
    1. Walk through of how to reinstall OS
    --> https://forum-en.msi.com/index.php?topic=167198.msg1224063#msg1224063
    2. I'll need a Super Raid card with links to get some, for about $100 each
    --> https://forum-en.msi.com/index.php?topic=171722.msg1252847#msg1252847
    3. I can't get Super Raid unless it originally came with it?
    --> https://forum-en.msi.com/index.php?topic=171185.msg1249640#msg1249640
    So what's the bottom line? Would I still be able to enable super raid in the future or am I SOL since it didn't come with it originally?
    thanks!

    The GT70 CAN come with an adapter that has 2 (on the older, GT70 0NX models) or 3 (on newer GT70 20X models) sockets for mSATA drives. It's an optional part, that takes place of the primary SATA drive in the notebook, and physically has a different part that connects to the motherboard. If it doesn't come with the SuperRaid adapter, then it just has support for a single 2.5" SATA drive.
    The GS70 on the otherhand, has this built into the motherboard and there is no swapping it out for a normal 2.5" SATA drive. You can only use mSATA drives (on those ports). The GS70 is meant to be an ultrabook, and therefore does not have the same ability as the GT70 to house up to 2 full size 2.5" SATA drives.
    That's really the main difference here. Without physically seeing a GT70 to see how the SuperRaid adapter works, it's slightly difficult to explain.
    But in the end, I wouldn't worry about the SuperRaid....The GS70 should have support for Intel Raid Management Engine, in which case that's all you really need.

  • 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.

  • Question about clear page and reset pagination

    Hi,
    I have a question about clear pages and the reset pagination in an URL. What is the reason why a clear page doesn't also trigger a reset pagination on the pages which are cleared?
    I can't really imagine a business case where it makes sense to clear all data of page items on a page and don't reset the pagination of reports on that page which probably use a page item in there where clause...
    The drawback of this behavior is that a developer always has to set the reset pagination checkbox when he clears the target page and the even bigger drawback is that if you specify other pages to clear, you can't reset pagination for them, because reset pagination only works for the target page.
    Thanks for your input.
    Patrick
    *** New *** Oracle APEX Essentials *** http://essentials.oracleapex.info/
    My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/

    Enhancement request filed, thanks,
    Scott

  • The question about portlet customization and synchronization

    I have a question about portlet customization and synchronization.
    When I call
    NameValuePersonalizationObject data = (NameValuePersonalizationObject) PortletRendererUtil.getEditData(portletRenderRequest);
    portletRenderRequest.setPortletTitle(str);
    portletRenderRequest.putString(aKey, aValue);
    PortletRendererUtil.submitEditData(portletRenderRequest, data);
    Should I make any synchronization myself (use "synchronized" blocks or something else) or this procedure is made thread-safe on the level of the Portal API?

    HI Dimitry,
    I dont think you have to synchronize the block. i guess the code is synchronized internally.
    regards,
    Harsha

  • A question about item "type and release" of  source system creation

    Hello expert,
    I have a question about item "type and release" of  source system creation.
    As we know,when we create a web servie source system,there will display a pop-up which includes three items as "logical system","source system"and "type and release".
    About the item "type and release",when we push "F4" button,there will be three default selections as below:
    "ORA 115     Oracle Applications 11i
    TLF 205     Tealeaf 2.05B
    XPD 020     SAP xPD".
    Who can tell me when and how should I use the three selections.
    And also I attempted to input the item by some optional letters except the default three selections and it seems that I can input it freely.
    Thank you and Best Regards,
    Maggie

    Hello DMK,
    Thank you very much for your answer.It is very helpful for me.
    Can I ask you further about it?
    I got that it is a semantic description item.
    You said the default selections are set by our basis people.Would you like to tell me how should we creat a new value except the default ones for item "type and release"?Only by inputing the value in the item directly?But you see we canot see the new value item we created by ourself when we push "F4" button next time ,is that ok?Or do we have to ask basis people to define one new value item just like the default seletions before we use it.
    Also if possible would you like to describe detail about "This becomes important when you are troubleshooting certain issues especially when RFC connection problems."
    Thank you and Best Regards,
    Maggie
    Message was edited by: Maggie

  • Question about setting cookies and custom authentication

    I have a question about setting cookies.
    I have two different 'projects' in HTMLDB - we will call them App1 and App2.
    I also have two different connection configurations setup in the DADs.conf file. - we will call them Connect1 and Connect2.
    App1 is setup to use database authentication (no user is specified in the DAD) and uses Connect1. Once the user successfully logs in, we set a username cookie (this is a persistent connection).
    We created a custom authenticatoin scheme for App2 - this scheme checks for the username cookie (set by App1). We would like for App2 to use Connect2 (HTMLDB_PUBLIC_USER is the default user specified and it uses connection pooling).
    Is it possible to set a cookie from App1, Connect1 for App2, Connect2 - then redirect to App2 and pick up that cookie?
    Here is an example of what we are trying to accomplish:
    A user loggs into App1, we set a cookie, and the user is redirected to App2. If the cookie exists, we allow them access to the home page in App2, if no cookie, we redirect back to a 'Login Failed' page in App1. We don't want App2 to use the same database connection as App1 though, we need App2 to use connection pooling.
    Is this possible? OR...Is there a better way to accomplish what we want to do?
    This is an enhancement to an existing app. Our requirements are to use Database Authentication (setup where pass expires after 60 days or so, cannot reuse last 3 passwords, etc.) - which is already setup and being used by other applications in our organization. All of our users have accounts in the database. We don't want users to have a new username/pass - and we don't want to manage a separate group for HTMLDB apps.
    The existing application uses HTMLDB's built in authentication - which uses database username/pass, and it uses connection pooling, but we cannot handle the pass expire stuff in it, unless there's something we're not seeing or understanding - at least that's how our DBA explained it to us.
    Any help with this will be appreciated so much. I can send you the code we have if needed.
    Thanks!

    Same problem here.  I have so many problems with this remote app.  Is there an iTunes API? I would like to write my own remote app that actually works.

  • Question about Custom Shape Files from newbie to PS

    My husband bought me PS CS4 Extended. That said, I have never used PS at all. I have always used PSP. Please don't hate me!
    I have figured out that one loads actions and presets. OK, got that. The question I have is if I can have my Custom Shapes and Actions on a completely different partition? I ask this because there is not enough room on the partition for me to continue adding shapes and such to PS in the program itself. I am figuring that I can since I have tio load them into the program anyway, but am asking to be sure so that I don't screw anything up.
    Another question I have is if I am able to point PS to where all of my plugins are that I already have installed in PSP, which also happen to be on a different partition. In PSP all one has to do is to point the program to where they are and all is good and they can be used within said program. Does PS allow for this also? If not, do I have to re-install all of the plugins into the PS program itself? I just don't have that much room on the partition that my PS resides on because of all of the other pregrams that I have. Also, does everything I load into PS just stay loaded or do I have to reload each time I want to use that particular preset?
    I do hope that ya'll can understand my questions and thank you for any help in advance.

    the benefit of having the presets in the proper folders is that you can select them from the fly-out menus instead of having to search for them using the Load command so yes, you can have them wherever you want. I doubt though that you don't have enough disk space for them, for instance, all the actions that come with Photoshop take up about 200kb, the custom shapes are about 700kb but that's because they come in duplicates. And yes, all that you load up stays in Photoshop until you remove them, no need to reload them at program start. For plug-ins you have the option to set an additional plug-in folder by going to Edit->Preferences->Plug-ins, don't know about needing to install them though as i don't use any

  • Satellite A200 - Question about HDD partitions and RAM

    This may be in the wrong section... I don't know.
    I've never owned an OEM OS and I also don't understand why the HDD comes partitioned 90, 2, 90 (who thought of that?).
    The thing is that I have to format and partition differently (since I have to dual boot Linux) and need to create a structure more like 40,40,100 or such. (100 being fat32 so data can be accessed for both)
    Now I'm just wondering which data I should be keeping from these drives. There's a folder called Toshiba on the C:\ drive which seems to have drivers and such, a few wallpapers and who knows what else. Then there's the D: drive called WinRE which has some sort of sdi and wim files.
    Another question, if I buy the 2GB which is listed in the compatible options for my laptop (A200-28P)
    Link: [http://uk.computers.toshiba-europe.com/innovation/jsp/individualOptions.do?service=UK&OPTION_ID=138301&t oshibaShop=true&selCategory=4700]
    Will it match the 2GB already in the laptop? Will it void the warranty in any way?

    Yes, I am using Vista, sorry, I forgot to mention that. The drive however is definately not hidden (it's clearly visible as the D drive and labelled WinRE).
    I'm not an idiot. I understand it, but you have got to admit that giving the OS 90 is a bit extreme and obviously I know what I can do with the other 90.
    I'd also like to point something out:
    "It's always advisable to partition an large HDD in more partition. This improves the performance because OS can access the files much faster."
    This is more than just an urban myth, it is down right stupid to believe that. After all, the data has a physical position on the drive and partitioning doesn't change the fact that it still has to get the needle to point to the location where the data is located on the drive.
    The needle still travels the same distance as referred to by the MFT.
    The question is if I can alter the partitions when using the strange Toshiba recovery disk. Afterall OEMs don't come with standard install disks and seem to limit your options.
    Again regarding the ram, I know the laptop can run 4 gigs, but I want to know whether the 2GB stick I'd buy from Toshiba would be the exact same as the one already installed, as in same timings and such.
    So in conclusion the data on D is worthless. What about the stuff in the Toshiba folder? And sorry if I sound condescending or like an *insert disallowed word here*, I'm just not in the best mood right now (serious data loss on my project because of a Uni server crash!).

Maybe you are looking for

  • Problem in Crystal Report 2008 selectionFormula

    Post Author: saro_j CA Forum: Crystal Reports Hi, I am having a strange problem in Crystal report 2008. Earlier I was using VS 2005 Crystal report. Then we purchased Crystal report 2008. When I open the VS 2005 projects it asks the reports to convert

  • Handling Multiple Error Messages through EXIT_SAPMM06E_012 for ME28

    Dear Team,                        After Executing ME28, system will give List of PO's that are to be Released . User will select Multiple  PO's and Press Release button in Application toolbar. once it is relased, User will press save Icon for all rel

  • SMImage plugin -- Any succes in integrating with ADDT?

    Before I plop down 100 euros for a wysiwyg text/image editor, I thought I ask if any ADDT users had had any success in integrating this plugin... Especially as regards ease of use in the Admin panel...

  • Issue in creating new project or model

    Hi, I am getting error message when i am trying to create new project or model. This is the error "java.sql.SQLException: ORA-00001: unique constraint (ODIW.PK_MOD_FOLDER) violated". Please tell me how can it be resolved. Regards, Anzeen

  • RMI Server exits early when using SSL

    Hi, Maybe someone else has encountered this one. My RMI server works fine when I use standard sockets. I create an instance and bind it into the rmiregistry. It then waits indefinitely for connections. When I use SSL, I can create the object instance