I cannot solve the problem-please help-IMPORTANT

I have got the following two classes. It shows the elements (double-numbers) of a matrix in a frame. The problem is, if the matrix consists of too much numbers , I am not able to see the whole numbers, but rather the first digit of each number.
I want to be able to scroll through the matrix and the numbers should be presented completely in the frame.
But how????;-(
public class MatrixFrame extends Frame {
public MatrixPanel matrixPanel;
public MatrixFrame(double[] [] values,int x, int y) {
matrixPanel = new MatrixPanel(values,x,y);
this.setSize(300,500);
this.setLocation(200,200);
add(matrixPanel);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
show();
}//MatrixFrame
public class MatrixPanel extends Panel {
MatrixPanel(double[] [] values,int l, int r) {
setLayout(new GridLayout(l,r));
for (int i=0;i<l;i++) {
for (int j=0;j<r;j++) {
add(new MatrixValue(values [j]));
//this.add(BorderLayout.CENTER);
setVisible(true);
class MatrixValue extends JComponent {
private double data;
MatrixValue(double d) {
data=d;
public void paint(Graphics g) {
Dimension d= getSize();
g.drawString(Double.toString(data),d.width/2,d.height/2);
Thanx for your help
Thomas

Instead of extending JComponent, your MatrixValue should extend JLabel. JLabel sizes properly, thus allowing you to place it within a ScrollPane. Otherwise you will have do something like this:
public MatrixValue extends JComponent {
public void paint(Graphics _g) {
Graphics2D g = (Graphics2D)_g;
Rectangle r = g.getFontMetrics().getStringBounds(Double.toString(data), g);
setPreferredSize(new Dimension(r.getWidth(), r.getHeight());
g.drawString(Double.toString(data),d.width/2,d.height/2);
}

Similar Messages

  • My iPad stop working suddenly i see black screen only pressing the home? and sleep button dose not solve the  problem please help?

    My iPad stop working suddenly i see black screen only pressing the home and sleep button dose not solve the problem please help ?

    Frozen or unresponsive iPad
    Resolve these most common issues:
        •    Display remains black or blank
        •    Touch screen not responding
        •    Application unexpectedly closes or freezes
    http://www.apple.com/support/ipad/assistant/ipad/
    iPad Frozen, not responding, how to fix
    http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    Black or Blank Screen on iPad or iPhone
    http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Home button not working or unresponsive, fix
    http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
    Fixing an iPad Home Button
    http://tinyurl.com/om6rd6u
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
     Cheers, Tom

  • Hi guys i have an ipad 1 and when i plug it in to my macbook pro picasa opens up and show its name but when i open itunes i cant find the name, ive been working my head out to solve the problem please help me:(

    hi guys i have an ipad 1 and when i plug it in to my macbook pro picasa opens up and show its name but when i open itunes i cant find the name, ive been working my head out to solve the problem please help me:(

    Pay no attention to iinami, the amount of replies to people saying their handsets must have been jailbroken everytime iTunes throws out an error is tremendous. (Clearly you don't need to have any real knowledge to get to level 3 on these forums, let's hope apple's geniuses know a lot more than some of their customers.)
    http://support.apple.com/kb/TS3694
    Solution below.
    Error 9
    This error occurs when the device unexpectedly loses its USB connection with iTunes. This can occur if the device is manually disconnected during the restore process. This issue can be resolved by performing USB troubleshooting, using a different USB dock-connector cable, trying another USB port, restoring on another computer, or by eliminating conflicts from third-party security software.

  • Invalid hotmail email account, can't solve the problem please help

    Hi,
    I got an email from my network required update password. I've entered her email address and password repeatedly and received the following message: 
    Invalid email address or password. Please verify your email address and password. The information you provided is incorrect. If the error persists contact hotmail.com (your email provider). Please try again. 
    Now I tried this more than 10 times from the blackberry email wizard and from my computer and still received the same messages. Also tried to change new password and set up again However still the same. I have 3 hotmail accounts, another 2 work well except my main email. (all of them are my personal email)
    Anyone can help?? Have no idea what wrong with my bb or hotmail. I went to Optus today, one of a staff said Sorry i can't help u as i have no idea about blackberry!!!! please help me.
    tried to delete and set up, take battary out ect... still can't set up it.

    All, please try it again now.
    By the way, my guy feeling is this is/was a MSN/Hotmail/Livemail server issue, as only those accounts were affected. Others such as Yahoo, gmail, etc., were not.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    My iPad shows a message "Cannot find AirPrint printer". I used to use my iPad to print materials using HP wireless printer D110. Now it does not want to print. Is this because I am now using IOS 7? What should I do to solve the problem? Help please.

    Restart your WiFi router and printer by removing power for 30 seconds.

  • My iphone 4 is acting like crap right i can't even restore it everytime i try to reboot it my iphone freezes at the apple logo it is ******* to the point where i just want to smash it how do i solve this problem please help?

    my iphone 4 is acting like crap right i can't even restore it everytime i try to reboot it my iphone freezes at the apple logo it is ******* me off to the point where i just want to smash it how do i solve this problem please help?

    Don't worry, just follow these steps to fix iPhone stuck on Apple logo
    => First of all Start your Computer and then connect with Internet connection, now Download the latest version of the iTunes application
    => Now install the iTunes application in your System and connect your Device with computer via Data cable
    => Now connect your Device with iTunes application and then Tab on summary option, see in the left side bar of iTunes
    => Now Select restore option from iTunes and then confirm the Restore Message for better results. After this unplug your Device and Restart it
    I hope that will surely
    Thank you...

  • My iphone is on recovery mode and i can´t turn on it, when i try to recover it from itunes i get: "unknown error (36), i´ve tried to do lot of things but i can´t  solve my problem. please help!!

    my iphone is on recovery mode and i can´t turn on it, when i try to recover it from itunes i get: unknown error (36), i´ve tried to do lot of things but i can´t solve my problem. please help!!

    Hi, i had the same problem. Try to find the file "apple" or "itunes" don't know it anymore exactly. Ahm well you need to delet any information or just plug in your iphone into an other computer. important is that your iphone never has been pluged in this computer before. This was what i did, and it worked!

  • Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Standard troubleshooting...
    1. Try a Restart by pressing the sleep/lock button until you see the slider.  Slide to power off.  Restart by pressing the sleep/lock button until you see the Apple logo.
    2. Try a Reset by pressing the home and sleep buttons until you see the Apple logo. Takes about 5-15 secs of button holding and you won't lose any data or settings.
    3. Remove apps from Recently Used list...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Swipe up on the app preview card to remove it from the list
    - Press the home button when done.
    4. If still a problem restore with your backup.
    5. If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
    6. If still a problem, it's likely a hardware issue.

  • Hello!i have problem to insttal potoshop cs6 this is,we've encountered the following issues.installer failed to initialize.this could be due to a missing file.please download adobe support advisor to detected the problem.please,help me

    this is,we've encountered the following issues.
    installer failed to initialize.this could be due to a missing file.please download adobe support advisor to detected the problem.
    please,help me!

    Hi there Mylenium, is there any way you can help me? My cs6 is doing all kinds weird things lately. The liquifying too stopped working completely, when I try to work with the actions, it starts flickering and changing opacity in color by itself. It starts flickering and is completely out of whack! I tried uninstalling and reinstalling and still no luck. I tried getting in touch with adobe and no luck with that neither! Is there anyway you might be able to help?

  • I am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you

    i am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you

    Did you check your security software (firewall)?
    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
    See:
    * [[Server not found]]
    * [[Firewalls]]

  • My Ipad 2 does not turn on when not plugged to electricity. Even when plugged to electricity, it constantly restarts/switches itself off. what is the problem, please help??

    My Ipad 2 does not turn on when not plugged to electricity. Even when plugged to electricity, it constantly restarts/switches itself off. what is the problem, please help??

    i plugged it and pressed the home button for a few seconds. the connect to itunes screen appeared and the moment i disconnect the cable from the electric plug, it switches off. when i connect the cable to the PC, nothing happens, its as if nothing has been done.

  • Hello sir my iphone screen turns off after using 2-5 minutes what would be the problem please help me out

    hello sir my iphone screen turns off after using 2-5 minutes what would be the problem please help me out

    To make sure that this is not software related, set it back to factory settings, without using any backup data afterwards. Set up the rest of the personal settings manually and test the phone. If it still does not work, this is a hardware issue and the phone has to be serviced by Apple or an Authorized Apple Service Provider:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Find an Apple Authorized Service Provider
    iPhone - Contact Support - Apple Support

  • ITunes gives code 42110 and 3014 and i cannot solve the problem

    iTunes gives code 42110 and 3014 and i cannot solve the problem. iphone out of order.

    Error 3014 means the following:
    Errors 3000-3999 (3004, 3013, 3014, 3018, 3164, 3194, and so on): Error codes in the 3000 range generally mean that iTunes cannot contact the update server (gs.apple.com) on ports 80 or 443.
    Update to the latest version of iTunes.
    Verify the computer's date and time are accurate.
    Check that your security or firewall software is not interfering with ports 80 or 443, or with the server gs.apple.com.
    Follow Troubleshooting security software. Often, uninstalling third-party security software will resolve these errors.
    An entry in your hosts file may be redirecting requests to gs.apple.com (see "Unable to contact the iOS software update server gs.apple.com" above).
    Internet proxy settings can cause this issue. If you are using a proxy, try without using one.
    Test restoring while connected to a known-good network.
    Error 3014 may indicate that you need to free up more disk space on the computer before trying to restore again.
    Here's the article containing the above: http://support.apple.com/kb/TS3694

  • HT5622 my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    Hey nocillado,
    Thanks for using Apple Support Communities.
    It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
    Get help activating your iPhone
    http://support.apple.com/kb/ts3424
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using the same Apple ID for Store purchases and iCloud (recommended)
    Have a nice day,
    Mario

  • My Ipod is disable, How can I fix the problem please help

    My I-pod is disable, how can I fix the problem, Please Help

    If it is disabled because of the passcode, see this article: iPhone and iPod touch: Wrong passcode results in red disabled screen
    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software.
    If the issue continues after updating and restoring your device, refer to this document.

Maybe you are looking for

  • How do I stop Game Center from logging me in EVERY TIME I open a game app?

    And who is using my username and password to log me in? I believe I have read all of the term, policies, and agreements and Apple makes no claim? I open an app associated with Game Center and I get a popup "welcoming me back." I open the Game Center

  • All-day Events Disappearing

    Hi, I switched to Mac last year and haven't had any problems until now. I was recently using iCal when it quit unexpectedly. I got the program to open again by deleting the application preferences (although I also tried repairing permissions). Howeve

  • My mac is incredibly slow all of a sudden!

    I went to a friend's house and tried to use his internet. It said there was a problem with the IP address so I just closed my mac and forgot about it. When I got home the whole thing is ridiculously slow. Websites take a minute a page to load so it's

  • Configurable product - ERP E-commerce 5.0

    Hi Gurus, E-commerce 5.0, ECC 6.0 .......... No TREX........VMC activated I have the following error once I add the configurable product to the shopping basket and then go to shopping basket. JCO Exception: COMMAND_EXCEPTION Function: CFG_API_GET_CON

  • Does portal handle arrays in the same way as sql+ (in a form based on a procedure)..

    I've got a package which has compiled without errors in Toad/Formatter Plus. When I try and create a from based on a procedure in PortalI get the error; Line/Column Error 88/24 PLS-00201: identifier 'ARRAY' must be declared 88/24 PL/SQL: Item ignored