Scrolling frame window

Hi,
I'm trying to make the following frame window scrollable, so when I add graphics it can scroll if the graphics are out of view. At the moment I get a scroll bar but with no scrolling. Even when graphics are out of view it doesnt scroll. Do I have to set the scrollpane or panel to a particular size.
can someone help please.
import java.awt.*;
import java.awt.Graphics2D.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.applet.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import com.borland.jbcl.control.*;
import javax.swing.event.*;
import javax.swing.border.*;
public class FrameProfile extends JFrame
     public FrameProfile(String title)
    super(title);
    JPanel Profilepane = new JPanel();
    Profilepane.setBackground(Color.white);
    int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
    int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    JScrollPane jsp = new JScrollPane(Profilepane, v, h);
    addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent e)
               dispose();
     setLocation(309, 54);
     setSize(476, 480);
  setContentPane(jsp);
     show();
    try  {
      jbInit();
    catch(Exception e) {
      e.printStackTrace();
   // Define paint() method for 2D graphical output
  public void paint(Graphics screen){
Graphics2D screen2D = (Graphics2D)screen;
super.paint(screen2D);
private void jbInit() throws Exception {
       }

Please copy and paste this code and compile and run this code
import java.awt.*;
import java.awt.Graphics2D.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.applet.*;import
javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
public class FrameProfile extends JFrame{
JTextField     t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18;
public FrameProfile(String title)
super(title);
     t1=new JTextField(10);
     t2=new JTextField(10);
     t3=new JTextField(10);
     t4=new JTextField(10);
     t5=new JTextField(10);
     t6=new JTextField(10);
     t7=new JTextField(10);
     t8=new JTextField(10);
     t9=new JTextField(10);
     t10=new JTextField(10);
     t11=new JTextField(10);
     t12=new JTextField(10);
     t13=new JTextField(10);
     t14=new JTextField(10);
     t15=new JTextField(10);
     t16=new JTextField(10);
     t17=new JTextField(10);
     t18=new JTextField(10);
JPanel Profilepane = new JPanel();
Profilepane.setLayout(new GridLayout(18,1));
Profilepane.setBackground(Color.white);
Profilepane.add(t1);
Profilepane.add(t2);
Profilepane.add(t3);
Profilepane.add(t4);
Profilepane.add(t5);
Profilepane.add(t6);
Profilepane.add(t7);
Profilepane.add(t8);
Profilepane.add(t9);
Profilepane.add(t10);
Profilepane.add(t11);
Profilepane.add(t12);
Profilepane.add(t13);
Profilepane.add(t14);
Profilepane.add(t15);
Profilepane.add(t16);
Profilepane.add(t17);
Profilepane.add(t18);
int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
JScrollPane jsp = new JScrollPane(Profilepane,v,h);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
dispose();}});
setLocation(309, 54);     
setSize(224, 280);
setContentPane(jsp);     
show();
try{
jbInit();
} catch(Exception e) {      e.printStackTrace();    } }
public void paint(Graphics screen){Graphics2D screen2D = (Graphics2D)screen;super.paint(screen2D);
      } private void jbInit() throws Exception {  }     
public static void main(String     arg[])
FrameProfile f =new FrameProfile("Title");
}

Similar Messages

  • Snagit v10 build 788 - unable to capture input - scrolling active window

    Hello,
    I use Snagit v10 build 788.
    I cannot use the "Scroll Active Window" option on Firefox 4 Beta.
    It does not work.
    I get the Snagit message : "Unable to capture input".
    Using Internet Explorer or on an other PC the Firefox v3.6, the "Scroll Active Window" option of Snagit v10 is working.
    How to solve it ?
    Thanks
    Caius

    FIXED!
    Guys, you will not believe how easy this is to fix! After hours of frustration I finally discovered a Firefox add-on called '''Screengrab'''. Install Screengrab, then right click in Firefox, choose Save, Complete Page - and you get a perfect scrolled page capture!
    Even better, you can open it in Snagit to work on it further (Screengrab saves it as a png)

  • Why CreateNewFrame() returns as NULL after successful created 136 child frame window and trying to create 137th child frame window in MDI application

    I am working on MDI application which was developed in VC++ in VS 2012. When my application is launched, it will display a Tree. Under a tree there are 254 nodes. Basically
    these nodes data are read from Configuration xml file and loaded into the Tree. By double clicking on each node, first it will create object for document class ( By calling CreateNewDocument() method) after that member variables for that
    document class will be initialized and then it will create the new frame window (by calling
    CreateNewFrame(pDoc,NULL). New child frame window will show under Main window to the user.
    User able to see the data from child frame window.
    Similarly by double clicking on each node it will create another object for the same document class and new child frame window will be opened for that node. Each child frame window runs
    in different data and showed under the Main window.
    Existing requirement by double clicking on each node, node data shall show in separate child window and there is no requirement for all 254 child windows opened simultaneously.
    But current requirement is , all 254 child windows shall open simultaneously by double clicking on each node one by one.
    In debug mode I have tried double clicking on each node. I able to open up to 50 nodes. After 50th child windows are opened, I unable to access to the application
    (Unable to open further node data window since application is getting hanged).
    Each child window is having tree, multiple splitter window and some additional controls (static text, ...).
    Same I have tried in release mode, I able to open up to 136 child windows. After that the application fail to create the new frame window in VS 2012. i.e CreateNewFrame() return
    NULL after successful created 136 child frame window. Debug purpose I have added the code to retrieve last error code by calling GetLastError() method. I got the value as "0". By closing any existing child window then I able to open remaining nodes.
    At any point of time I can reach maximum of 136 child frame window that can be opened under Main window. Failing to open all 254 child frame window
    simultaneously,  currently I fail to meet the current requirement.
    current Requirement is all 254 child frame window are opened simultaneously. Please let me know what may be the reason fail to create new frame window after 136 frame window that are
    opened already. In Microsoft site, mentioned that there is no limitation for creating frame  window in MDI application. I have tried another sample MDI application having limited number of controls, in which I able to create "n"
    number of child frame windows. why not able to create more than 136 child frame window in my actual application?
    Is there any possibility by changing project settings allow me to create 254 child frame window??
    Code Snippet as below:
    CDiagBaseDoc * CDiagBaseMDocTemplate::OpenDiagView( ...)
         CDiagBaseDoc* pDoc = NULL;
        if (pDoc == NULL)
            pDoc = (CDiagBaseDoc*)CreateNewDocument();
        if ( pDoc )
           CFrameWnd* pFrame = NULL;
           if (bAlreadyOpen)
                  // If Child frame window already opened, then handling the code here.
         else
               pFrame = CreateNewFrame(pDoc, NULL);
               if (pFrame == NULL)
                  ASSERT(FALSE);
                  delete pDoc;       // explicit delete on error
                 pDoc = NULL;
              ASSERT_VALID(pFrame);
              if( pDoc != NULL ) //VS2012
                 if ( !pDoc->OnNewDocument() )
                    TRACE0("CDocument::OnNewDocument returned FALSE\n");
                    delete pDoc;       // explicit delete on error
                    pDoc = NULL;
                    pFrame->DestroyWindow();
                     pFrame = NULL;
           if (pFrame)
               InitialUpdateFrame(pFrame, pDoc);
               ShowWindow( pFrame->GetSafeHwnd(), SW_MAXIMIZE ); //when opening node for the 1st time, maximize it
    }<o:p></o:p>

    Hi MuruganK,
    Have you checked how much memory your application used? You could check it by Task Manager. Maybe your application reach Memory Limits for Windows.
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    Is it possible that there are some memory leaks in your application? It would better if you have made a simple sample to reproduce and narrow down this issue.
    Best regards,
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with Java scrolling text window on Mac OS

    The Java scrolling text window created by AWT "TextArea" scrolls in the normal way from the top on Windows, whereas it scrolls from the bottom on the Mac OS. That is, the text file is first displayed from the bottom on Mac, so that the user has to scroll to the top of the file each time a new page is opened, which is a very nuisance. Have you run into this problem and do you know how to over-ride the Mac OS default? Many thanks.

    TextAreas suck in general, this has been discussed many time in the forum. As a duct-tape fix, you might play around with setCaretPosition() after inserting your new text. Good luck

  • Swipe to next article in horizontal scroll. frame

    Hi,
    If the reader reaches the end of an horizontal scrollable frame, the swipe to the next article does not work (neither does two finger swipe work). Instead, swiping to the next page on the end of an vertical scroll. frame works fine (v29 viewer).
    One more thing to fix.
    Kind regards,
    Yves

    Yves,
    Are you testing in Adobe Content Viewer or a custom viewer? We specifically did work to make swiping to the next article work inside a horizontal scrollable frame.
    Neil

  • Sound clip under scrolling frame

    Trying to place a sound clip beneath a scrolling frame in article. Separately, the scrolling frame and image with sound control buttons work fine. Combining the two results in scrolling frame working but sound controls being inactive.
    I've tried layers and mso with a button stating to advance to next state on release of scrolling frame.
    Anyone have a solution for making this work? Thanks!

    Are you trying to put the sound controller behind (on the Z-axis) the scrolling frame, or are you trying to put it below (on the Y-axis) the scrolling frame? Just want to make sure you aren't blocking the controls.
    If you are putting the controller below the scrolling frame, are you sure it isn't being covered by any part of the frame, or some other overlay?
    Screenshots of this would be very helpful.

  • Samsung p2270 scrolling and window lag

    I have a new 2.8ghz xenon Mac Pro with 6 GB of ram. It's attached to a Samsung P2770HD monitor via a DVI cable.
    When I scroll a window in Safari, or drag any window, or even when a new window is opening, it is extremely laggy and redraws the window very slowly. I've tried adjusting all of the monitor settings with no success. I have no options to change in the monitor prefs.
    Any advice??

    I'm using the same monitor on a macpro with the ATI HD 5770 card. I don't have a problem with moving windows but when I set my resolution to 1920x1080 the image goes off the screen. I can't see any of my icons on the far right or left. Do you have that issue?

  • Changing the colour of frame window

    How can I change the colour of frame window and set some other colours?
    Rony

    Yes I did. I got this code by Rodney.
    JFrame.setDefaultLookAndFeelDecorated(true);
    UIManager.put("activeCaption", Color.RED);
    JFrame frame = new JFrame();It is a good one. But the extreme outer border still looks blue. Also, a window like icon is shown and some dots are shown near to minimize button. How to avoid these?
    Rony

  • How to access the handle of  the Frame window ?

    How to access the handle of the frame window through out the application ?. I want to display an alert box, while I click the fifth inner child component of the Frame . I am using Dialog Class for the alert box, I have to pass the frame handle to the Dialog constructer, I am getting the handle of the frame by getParent().getParent()......getParent().. But can any one suggest any better solution.

    If you application extends Frame or JFrame, you could simply refer to "this", or if you create a global or final Frame object that you use as your "top-level" component, you could refer to it this way. Additionally, if you're ever in a situation where you really need to go all the way to the top through n levels of components, I believe you could always do something like this...
    // assume myContainer is the "child" component that you're on, and you want to find its top-level parent
    Container c = myContainer;
    while (c.getParent() != null) {
         c = c.getParent();
    }

  • Multiple scrolling frames in MSOs

    Can anyone else confirm that if you have more than one scrolling frame inside an MSO, at least one of those scrolling frames will appear blank when viewed on the iPad?
    I'm having a lot of trouble trying to work around this; wondered if anyone else has encountered this...
    Thanks.

    Since the new viewer and bugfixes are ready to use, you can solve the scrolling frame problem with the following workaround...
    http://blogs.adobe.com/jlockman/2012/02/08/nested-overlay-solution-for-dps/

  • Auto starting scrolling frame

    Scrolling frames are great but cannot be autostarted. That means something like a long movie credit list, as far as I understand, can only be a movie that I prepare in Flash and takes a lot of memory.
    I also tried via an external html page that does trigger scrolling text automatically in my browser, but the import into DPS does not work.
    Unless I am maissing something?
    Thanks

    I'm trying to do the same (auto start a scrolling frame), but am having trouble as well. I've tried the <marquee> html tag and it works when I preview the html in my browser (Firefox) and works in the Adobe DPS desktop content viewer. However, it does not work on the iPad.
    My current work around is to create the scrolling animation in Hype and import it as a local html file. Unfortunately, the scrolling animation in Hype has some jumpy spots.

  • Scrolling a window

    Is there a way to open a macro in design view and scroll the window to a desired percentage?
    in VBA of course
    Thanks
    50% of programming is coding. The other 90% is debugging

    ​Hi JonWayn,
    >> Is there a way to open a macro in design view and scroll the window to a desired percentage?
    What do mean by "scroll the window to a desired percentage"? Do you want to open a macro in design view? If so, I think you could try to select the macro object and send the key "CTRL +ENTER" to achieve, some key code like below:
    Sub OpenMacroInDesignMode(sMacro As String)
    DoCmd.SelectObject acMacro, sMacro, True
    '-- CTRL+ENTER will open the macro in design view
    SendKeys "^{ENTER}"
    End Sub
    You could turn to the link below for more information about SendKeys
    # SendKeys Statement
    https://msdn.microsoft.com/en-us/library/office/gg278655.aspx
    If you want to scroll the window to a desired percentage, I am afraid that it is not achievable​, you need to scroll the window manually.
    If I misunderstood you, please feel free to let me know.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Audio breakup when I scroll a window...

    I was listening to some MPEG3 music on my hard drive with Window Media Player 9 whilst browsing the internet when I noticed the sound distorting whenever I used the keyboard cursor keys to scroll down the page. It doesn't happen if I use the mouse scroll wheel or the mouse to drag the bar down!
    I'm using the mainboard's onboard sound via the latest Realtek AC'97 audio codecs as they are better than the ones that came with the nVIDIA nForce driver pack.
    Can anyone please tell me why the sound breaks up when using the keyboard?

    I've just read in PC Gaming Hardware World magazine that the nVIDIA IDE drivers included in their nForce2 driver pack are a bit buggy i.e. not very good and that you should replace it with the Standard IDE driver included with Windows XP so I'm going to see if that resolves the problem. It apparently affects the ability to burn CDs and DVDs too which I've had a few problems with especially with verifying the data.
    Thanks for your help!
    The weird thing about the sound bug is that if you have the Task Manager open and then scroll the window using the keys the sound plays fine!!! Talk about bizarre...

  • How do you properly create a button in a scrolling frame?

    I am having trouble getting buttons in a scrolling frame to work correctly. Here is what I have set-up. I have a multi-state object on the right side of the page. On the left, I have a text box with inline buttons inside of a content frame which is set to Pan Only. The inline buttons are set to Go To State in the multi-state object on click. When I preview the document in the Adobe Content Viewer, the scrolling works, but tapping on the buttons only brings up the navigation bars at the top and bottom. When I go back to my document, I notice that the buttons no longer have my settings to display the multi-state object (on click). Thanks for any help!

    In scrollable frames, only URL-based buttons are currently supported. Buttons that jump to a slideshow are not yet supported. If all goes according to plan, the next release of tools will allow buttons in scrollable frames to jump to slideshow states.

  • How i disable the frame window??

    how i disable the frame window??
    i had used frame.disable(); function but its not work...
    disable function works only on components its not work on frame..

    hi!
    1) which one you are using? Frame/JFrame ?
    2) exactly what do you want to disable?
    a) entire frame including titlebar buttons
    b) just all the child components, menus, toolbar buttons
    c) what should be the behavior of taskbar at the time of disabled frame object?
    i think for a proper and to the point solution these are thing one need to know.
    regards
    Aniruddha

Maybe you are looking for

  • CSS style -Background not showing ?

    hi everybody , first of all i'm quite new to Dreamweaver and webdesign word so ... sorry if i make mistakes when trying to prewiew my site , or in dreamweaver itself , i cant see my background (is a .png file made whit photoshop , a simple gradient w

  • WSN 9791, 3202 error handling

    I have setup a 9791with 3202 and attached a 250ohm resistor to measure a 4-20mA signal at AI0 of the 3202. I am continously measing the input voltage and I am also checking battery voltage, link quality, external power and error messages with simple

  • UC540 CTI Integration

    We have installed a UC540 for a customer - Insurnace Agent.  The customer is using an application called eAgent.  The customer would like to integrate eAgent with UC540/SPA504G telephones. The objective is that when someone calls then the eAgent Appl

  • Error message:  .Mac account credentials validation failed for account...

    I have published via iWeb for some time, but after I created a new webpage, I have been unable to publish again. This is the latest error message... ".Mac account credentials validation failed for account "account name." I have tried publishing via w

  • MBA upgraded to Yosemite and the widget desktop disappear.

    Hi, I just upgraded my MBA to Yosemite and after the system rebooted, I can't switch to the left desktop for the widgets. Please help. Thank you.