How to add a vertical scrollbar?

Been searching FOREVER now!
How do I make a Tabbed panel with a fixed size, and then content is scrollable in vertical direction?
like this site: Sigurd Rakel | Bilder
Or inside a composition for that matter?

There is a way of doing this using an iFrame. It’s not particularly elegant but it does work. The only caveat is you wouldn't be able to have the lightbox effect shown in the site you referenced, as it would appear within the panel's frame, rather than on the main page.
Create your tabbed panel on the page. Make a note of the content area’s width.
Now you need to create a new page for the content you want to display in the tab. I’ve created a Master page for this, as it will let you quickly create new content at with the correct settings.
Open the Master's Page Properties. Set the page width to the width of the panel content area. Remove all padding and margins.
Open the new master. Remove the header and footer padding.
Go back to the Plan view. Create a new page based on the new master page. Also remember to remove the page from the menus!
Add your content so it fits the width of the page.
Go back to the page with the tabbed panel. Select Insert HTML from the Object Menu. Add this line of code (substituting the page name and panel dimensions for your own): <iframe src="panel-text.html" width="480" height="510" frameBorder=0 />.
Position and resize the HTML frame inside the panel. The content won’t show in the frame as it’s referencing a page that’s yet to be rendered. You might also want to adjust the panel size to suit.
Select Preview Site in Browser from the File Menu. All being well, you should see the content inside the panel, which will scroll independently.
I hope this helps.
David

Similar Messages

  • How do you add a Vertical scrollbar to a JTextArea?

    How do you add a Vertical scrollbar to a JTextArea? This is what I've tried so far but it hasn't worked. I got that off of someone asking a similiar question here.
    aTextArea = new JTextArea(10, 40);
             JScrollPane scrollPane = new JScrollPane(aTextArea);
             aTextArea.setText( " " );

    JScrollPane(component)
    this constructor will only show the scrollbar (vertical and/or horizontal) as needed..so, if the scrollpane viewport is larger than the component, then it will not show the scrollbar.
    you can force the scrollbar to alway show
    setHorizontalScrollBarPolicy(int policy)
    setVerticalScrollBarPolicy(int policy)

  • How to add text vertically into a Word margin with C# (using namespace: Microsoft.Office.Interop.Word)

    I need to add text vertically in a word document outside the margins.  How can I do this with Microsoft.Office.Interop.Word and C#?
    Leonard Swarczinski Software Developer Postal Center International

    Hi Leonard,
    According to your description, do you want to add text vertically into Page Header/Footer? I wrote a sample  for you.
    using Microsoft.Office.Core;
    using Microsoft.Office.Interop.Word;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace AddTextToWord
    class Program
    static void Main(string[] args)
    CreateNewDocument();
    Console.ReadLine();
    private static void CreateNewDocument()
    Object oMissing = System.Reflection.Missing.Value;
    Microsoft.Office.Interop.Word.Application oWord;
    Microsoft.Office.Interop.Word.Document oDoc;
    oWord = new Microsoft.Office.Interop.Word.Application();
    oWord.Visible = true;
    oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    String HeaderText = "Hello everyone!";
    WdParagraphAlignment wdAlign = WdParagraphAlignment.wdAlignParagraphCenter;
    AddHeader1(oWord, HeaderText, wdAlign);
    private static void AddHeader1(Application WordApp, string HeaderText, WdParagraphAlignment wdAlign)
    Object oMissing = System.Reflection.Missing.Value;
    WordApp.ActiveWindow.View.Type = WdViewType.wdOutlineView;
    WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekPrimaryHeader;
    Microsoft.Office.Interop.Word.Shape textBox = WordApp.ActiveDocument.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationVertical, 150, 10, 40, 40);
    textBox.TextFrame.TextRange.Text = HeaderText;
    WordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekMainDocument;
    If I misunderstood or anything wrong, please let me know and you can get more information from below articles.
    Office development in Visual Studio
    http://msdn.microsoft.com/en-us/office/hh133430.aspx
    Abhout: AddTextbox Method
    http://msdn.microsoft.com/en-us/library/office/aa171543(v=office.11).aspx
    How to: Programmatically Insert Text into Word Documents
    http://msdn.microsoft.com/en-us/library/vstudio/6b9478cs.aspx

  • How to move the vertical scrollbar ?

    Hi
    How can I move a vertical scrollbar in the HTML page to a desired position.The position is actually a list tag element.?

    This is a Java forum. Java has nothing to do with Javascript.

  • How to add a vertical line in crosstab

    Hi guys,
    Like below picture, I'm designing a crosstab, with many columns.
    How to add a line between each other?
    Thanks.

    Hi Hu,
    CR doesn't draw gridlines for summaries unfortunately. This has been a feature that has been requested quite a few times and you should be able to find it in the Ideas Place as well.
    Only two workarounds for now:
    1) Draw a line manually using the line object or
    2) Turn On right/left borders for the field.
    -Abhilash

  • How to add seprator to ScrollBar in JScrollPane?

    I have a JScrollPane. I am trying to add border to ScrollBar so ScrollBar looks seprate from pane.
    Is there anyother way to do this so ScrollBar look seprate from scrollPane?? thanks in advance!!!
    thanks
    amit

    Border b = ...; // your border here
    UIManager.put( "ScrollBar.border", b);http://www.gargoylesoftware.com/papers/plafdiff/ScrollBar.html

  • How to add a vertical resize bar for each TableRow in a TableView?

    I am looking for a best approach / best practice to accomplish this task. I need to be able to implement, in the least, re-sizable (by dragging on a divider line) TableRows. I understand this to be a bit more difficult to retain the height of each individual TableRow because they are virtual and reused. My first goal is only to have all TableRows re-sized (eliminating the need to carry individual row sizes ).
    I am able to implement my own TableRow by extending TableRow - and I was able to retrieve a reference to the TableRow's Skin and adding a divider line (Rectangle) and capturing the Mouse events to effectively re-size the height of the Row by dragging.
    My Question is this: Without implementing a new TableRowSkin - how can I force the divider line to be at the bottom of the TableRow? Currently - I am just adding the Rectangle Node (Divider) to the TableRowSkin's children list - causing the divider line to be positioned at the top of the TableRow (This gives an odd feeling when resizing - the line should be on the bottom).
    I feel like I am hacking at the issue without realizing the intent of the JavaFX developers. Is the intent for Row Height resizing to be implemented by providing a new Skin? There doesn't seem to be an easy way to accomplish this task using the existing TableRow or TableRowSkin.
    I can post example code if requested - but I will need to condense the example to a small enough self-contained file.
    If the answer is "Yes - implement a new skin" that is fine, but this task might be difficult without the source code for guidance :) [hint..hint..]

    After attempting to override the TableRow itself - I ran into a bug in the underlying skin causing a ClassCastException when sorting on the headers - apparently the underlying TableRowSkin doesn't like it when you add anything other then a TableCell (I added a Rectangle in this case, could not be cast to a TableCell). The bug was filed in Jira and fixed for 2.1 - so in the mean time I took the individual TableCell approach - add a divider to the bottom of each tableCell.
    The trick is not the the divider - but it is the other Control you have above the divider. I am using a TextArea, and you may generally want to override the PreferredHeight otherwise the height of the Control continues to extend. This behavior may be a result of using VBox to house the TextArea and the Rectangle vs your suggestion of a BorderPane.
    I was able to get the aesthetic functionality working to my desire. NOTE: functionality needs to be added for the table to "remember" any change of tablerowheight for each associated data item - otherwise the TableRow with the differeing height will get recycled and used for a different data item later. This shouldn't be too hard to implement with a Map for every non-default tableRowHeight change with a key of the TableRow Data Item. (Perhaps a max memory of associations as to not use up all available memory if someone wanted to resize all rows, for instance. Or we could also apply a new default Row size as well. I'm thinking this functionality should be applied to a sub-classed TableView).
    editThe posted code does not have a bug - it is placing the vertical resize divider in each cell, not each tablerow. Aesthiticaly - it will take some additional tweaking. You will notice the Textarea scroll bar "bleeds" into the other Transparent cells.. Not a critical bug, but an issue to deal with I will have to tackle later. If I can hack into the TableColumn resizing behavior - or set a minWidth on each Tablecolumn - that will be my approach to deal with it for now.--edit--
    public class TextAreaCell<S> extends TableCell<S,String> {
            private TextArea textArea;
            private StringProperty boundToCurrently = null;
            private Rectangle r = new Rectangle(1,3,Color.TRANSPARENT);
            private VBox vbox = new VBox();
            public TextAreaCell() {
                this.getStyleClass().add("table-cell-for-controls");
                textArea = new TextArea();
                textArea.getStyleClass().add("table-cell-text-field");
                textArea.setWrapText(true);
                textArea.prefHeightProperty().set(5);
                textArea.minHeightProperty().set(0);
                vbox.getChildren().add(textArea);
                vbox.getChildren().add(r);
                vbox.setFillWidth(true);
                r.widthProperty().bind(vbox.widthProperty());
                r.setCursor(Cursor.V_RESIZE);
                r.setOnMouseDragged(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        TextArea y = TextAreaCell.this.textArea;
                        TextAreaCell.this.printTextAreaInfo(y, event);
                        TableRow tr = TextAreaCell.this.getTableRow();
                        double newHeight = tr.getHeight() + event.getY();
                        if (newHeight <= 24) {
                            newHeight = 24;
                        tr.setPrefHeight(newHeight);
                        tr.requestLayout();
                VBox.setVgrow(textArea, Priority.SOMETIMES);
                vbox.setMinWidth(1);
                this.setGraphic(vbox);
            @Override
            protected void updateItem(String item, boolean empty) {
                super.updateItem(item, empty);           
                if(!empty) {
                    // Show the Text Area
                    this.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                    // Retrieve the actual String Property that should be bound to the TextField
                    // If the TextField is currently bound to a different StringProperty
                    // Unbind the old property and rebind to the new one
                    ObservableValue<String> ov = getTableColumn().getCellObservableValue(getIndex());
                    SimpleStringProperty sp = (SimpleStringProperty)ov;
                    if(this.boundToCurrently==null) {
                        this.boundToCurrently = sp;
                        this.textArea.textProperty().bindBidirectional(sp);
                    else {
                        if(this.boundToCurrently != sp) {
                            this.textArea.textProperty().unbindBidirectional(this.boundToCurrently);
                            this.boundToCurrently = sp;
                            this.textArea.textProperty().bindBidirectional(this.boundToCurrently);
                else {
                    this.setContentDisplay(ContentDisplay.TEXT_ONLY);
            private void printTextAreaInfo(TextArea t, MouseEvent e) {
                StringBuilder s = new StringBuilder();
                s.append(e.toString()).append("\n");
                s.append("\tTextArea.prefHeight:").append(t.getPrefHeight()).append("\n");
                s.append("\tTextArea.MinHeight:").append(t.getMinHeight()).append("\n");
                s.append("\tTextArea.MaxHeight:").append(t.getMaxHeight()).append("\n");
                s.append("\tTextArea.Height:").append(t.getHeight()).append("\n");
                s.append("------------------------------------------------------------------------------------------------------------------------");
                System.out.println(s.toString());
    }And the Css
    .table-cell-for-controls {
        -fx-skin: "com.sun.javafx.scene.control.skin.TableCellSkin";
        -fx-padding: 0; /* 2px, plus border adds 1px */
        -fx-background-color: transparent;
        -fx-border-color: -fx-table-cell-border-color -fx-table-cell-border-color -fx-table-cell-border-color -fx-table-cell-border-color;
        -fx-border-width: 0.083333em; /* 1 */
        -fx-cell-size: 2.0em; /* 24 */
    .table-cell-text-field {
        -fx-background-color: transparent;/*-fx-control-inner-background;*/
        -fx-background-insets: 0;
        -fx-background-radius: 0;
        -fx-padding: 3 5 3 5;
        -fx-prompt-text-fill: derive(-fx-control-inner-background,-30%);
        -fx-cursor: text;
    }Edited by: jkaufmann on Nov 7, 2011 4:33 AM

  • How to add a vertical barcode on the side of each page?

    I'm trying to add vertical barcode on the side of each page in my crystal reports. "Format with multiple columns" wouldnt work, because I need the barcode to be from top to the bottom of the page.
    Thanks in advance.

    Hi,
    Well, I'm not sure how this can be done considering the barcode needs to display irrespective of the way sections execute.
    It's as if the barcode needs to be placed at the end of the page-width (in a section of its own) that runs vertically(down) to the end of the page.
    Here's something that I tried though and almost succeeded!
    1) Create a simple report against the extreme sample database
    2) Three fields in the details section
    3) Create a formula called group:
    whileprintingrecords;
    4) Create a group on this formula
    5) Add the barcode field toward the end of the Group Header section and increase its height
    6) Go to the Group Expert and select the group > Options >options tab > check 'Repeat Group header on each page'
    7) Go to the Section Expert, select the Group Header section and check the 'Underlay Following Sections' option
    8) Suppress the Group Footer
    You'll still notice that the barcode doesn't actually run from the top to the bottom of the page; there's still some blank space at the top and bottom.
    Another thing to try would be to suppress the Report Header and the footer, Page footer, Group Footer.
    Push the barcode field to the Page Header, bring down the contents of the Page header to the  Group Header (Make sure you've got 'Repeat Group Header on each page' turned ON) and have the 'Underlay Following Sections' checked ONLY for the Page Header.
    This takes care of the barcode not running until the end of the page, although it still leaves some blank space at the top and the bottom.
    This blank space can be reduced to a minimal by setting the top and the bottom margins to 0 from the Page Setup.
    Again, the second approach looked better to me and the barcode runs from the top of the page all the way to the bottom on every page without affecting the detail section processing. But this is a very simple report that I created and you might have some work to do on your's!
    Give it a shot and let me know how it goes.
    -Abhilash

  • How to  make the vertical  scrollbar  moved  automaticlly?

    Hi:
      I make a  program using BDC to create  POs.
      In my bdc recording process, i only inserted a line material item ,  but now in my program i failed  to  insert material items  over <b>7</b> because the screen only have 7 lines in default situation. how to solve this problem?   thanks inadvance!

    Hi guixin chen
    But programming for the scroll bar is never a good idea...
    Simply because thsi depends on the GUI settings on OS settings of the user.
    and you cant possibly program to consider all this.
    The best option as somebody suggested is to use teh bapi/fm.
    If u r trying to add some items to the PO in BDC, you might also have the option through the menu to add a new item. use that instead of a scroll. This will make ur BDC GUI settings independant.
    Rgds,
    Prashanth.

  • IFrame - How to keep the vertical scrollbar, but NOT the horizontal one?

    I have the iFrame set-up fine in the site - http://www.pebbleplace.com/Personal/Start.html
    And it works as expected in Safari, but in Firefox a horizontal scrollbar shows up... How can I can keep the horizontal scrollbar from showing up? It's not needed - the content is skinnier the iFrame. This is the code currently being used -
    <iframe src=
    "http://www.pebbleplace.com/Personal/StartLatest_EntriesList.html"
    style="width:728px; height:408px;
    border-color:#990033;
    border-style:none;
    border-width:1px"
    scrolling="yes" >
    </iframe>
    I've seen some parameters such as "overflow-x:hidden" when Googling this topic, but I'm not sure where to place that command. Nor did it sound like it should be used in-line the code shown above. Coding is NOT my thing, so I really appreciate the help.
    Thanks

    Thank you. Unfortunately I had to pull the iFrame. It was on the front page and displayed all the "Latest Entries" list. I was using the iFrame as scrolling list box - this way I could keep all the entries on the front page. Right now there is only room ~10 entries.
    Anyway, I pulled the code because when I clicked on it, it opened the page inside the iFrame. That wasn't what I expected. I wanted it to open the page in the same Safari tab, not in the tiny iFrame. I'm kind bummed because it looked good and would have worked nicely - if it didn't open the links in the iFrame.
    I think I could trick it by linking to my pages as an external reference and forcing them to be opened in a NEW browser window. I may try that next weekend when I have more time to work on this again.
    Thank you for the response.
    John

  • How to make only vertical scrollbar?

    my codes are shown as the following 2 classes:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JScrollPane.*;
    class showConsole2{
    public static void main(String argv[])throws Throwable{
    consoleFrame csf = new consoleFrame();
    csf.show();
    class consoleFrame extends JFrame{
    public consoleFrame()throws Throwable{
    super("Console"); setSize(150, 200);
    JPanel p1, p2, p3, p4, p5, p6, content ;
    p1 = new JPanel(); p2 = new JPanel();
    p3 = new JPanel(); p4 = new JPanel();
    p5 = new JPanel(); p6 = new JPanel();
    content = new JPanel();
    JLabel l1, l2, l3, l4, l5, l6;
    l1 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    l2 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    l3 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    l4 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    l5 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    l6 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
    p1.add(l1); p2.add(l2); p3.add(l3);
    p4.add(l4); p5.add(l5); p6.add(l6);
    content.add(p1); content.add(p2); content.add(p3);
    content.add(p4); content.add(p5); content.add(p6);
    setContentPane(content);

    Here is the code :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JScrollPane.*;
    class showConsole2{
    public static void main(String argv[])throws Throwable{
         consoleFrame csf = new consoleFrame();
         csf.show();
    class consoleFrame extends JFrame{
         public consoleFrame()throws Throwable
              super("Console"); setSize(150, 200);
              JPanel p1, p2, p3, p4, p5, p6,content;
              JScrollPane content1;
              content = new JPanel(new GridLayout(6,1));
              content1 = new JScrollPane(content);
              content1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
              content1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
              p1 = new JPanel(); p2 = new JPanel();
              p3 = new JPanel(); p4 = new JPanel();
              p5 = new JPanel(); p6 = new JPanel();
              JLabel l1, l2, l3, l4, l5, l6;
              l1 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              l2 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              l3 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              l4 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              l5 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              l6 = new JLabel("aaaaaaaaaaaaaaaaaaaaaaa");
              p1.add(l1); p2.add(l2); p3.add(l3);
              p4.add(l4); p5.add(l5); p6.add(l6);
              content.add(p1); content.add(p2); content.add(p3);
              content.add(p4); content.add(p5); content.add(p6);
              setContentPane(content1);
    }Good Luck

  • How to add vertical scrollbar to a tree region

    Hi,
    I have a page containing two regions. The first is a tree region displayed on the left hand side of the page. The second is form region displayed to the right of the tree, showing details relating to the selected node from the tree.
    How can I add a vertical scrollbar to the tree, so that I can I browse all nodes in the tree without affecting the position of the form? Currently, if my tree extends beyond the height of the page I have to use the page vertical scrollbar to view the bottom of the tree. This obviously means that the form is no longer in view.
    Thanks
    Andrew.

    Hi Andrew,
    You can't add a scrollbar directly to the region's contents, but you can wrap the contents within a DIV tag.
    In the Region Header add in:
    &lt;DIV style="height:500px; overflow:auto"&gt;
    In the Region Footer add in:
    &lt;/DIV&gt;
    Obviously, change the height value to suit your needs.
    Regards
    Andy

  • How to add vertical stroke to between top menu items?

    I have a horizontal Spry menu bar. How to add a vertical stroke between menu top items?
    BUT NOT outermost left and outermost right. Only to BETWEEN top menu items.
    In html file I tried this:
      <div id="main_menu">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Products</a></li>
          <li class=stroke></li>
          <li><a href="#">Services</a></li>
          <li class=stroke></li>
          <li><a href="#">News</a></li>
          <li class=stroke></li>
          <li><a href="#">Contact</a></li>
         </ul>
       </div>
    And in CSS-file I made a style:
    #MenuBar1 .stroke
    display: block;
    width: 1px;
    height: 16px;
    background-image: url(../images/gui/vertical_stroke.png);
    background-repeat: no-repeat;
    In Safari this Spry menu bar work fine. But stop working in Firefox and IE.
    Also DW4 warning me in properties panel that:
    "This menu bar is missing some important tags. Go to Code view and and make sure that each menu item contains an <a> tag."
    What is correct method to do this?

    In that case you will need to use images.
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Untitled</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    <style>
    ul.MenuBarHorizontal a.line {    background: #EEE url(SpryMenuBarLine.gif) no-repeat 95% 50%; }
    ul.MenuBarHorizontal a.MenuBarItemSubmenu.line{    background: #EEE url(SpryMenuBarDownLine.gif) no-repeat 95% 50%; }
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu line" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li><a href="#" class="line">Item 2</a></li>
      <li><a class="MenuBarItemSubmenu line" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li><a href="#">Item 4</a></li>
    </ul>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    The images look similar to the following
    and
    I hope this helps.
    Ben

  • How to add the scroll bar in the vertical photo gallery?

    like this, how to add the scroll bar? http://www.flashvault.net/tutorial.asp?ID=288 Thanks,

    I want to know how to add a vertical scroll bar in the photo gallery which I copied from the tutorial. And add the event to catch MouseEvent.CLICK for each photo. Please advise. Thanks,

  • How to add scrollbar to jpanel

    i created a jpanel with images & related text to images, which repaints dynamically according to width,now i wann to add a vertical scrollbar to it.
    plz..help me

    iam getting scrollbar but iam unable to get scrolling when i change the size
    my code like this....
    //here iam using jpanel to get images and text
    public class ImgNtext extends JPanel {
       public ImgNtext(){
           //to intialize values
           init_values();
      public void init_values{
       //In these init_values iam decalaring imageFile name & text using hashtable
       public void paintComponent(Graphics g) {
             super.paintComponent(g);
             //getting width of screen
             int gw = getWidth();
             //then iam retriving all the values using while loop
             while(i.hasMoreElements())
                        //accroding to width iam painting the components
                          if(gw<100){
                               g.drawImage(image,x,y,null);
                               g.drawString(string,x,y+80);
                               gw -=100;
                               x += 100;
                         else{
                               y += 100;
                               gw = getWidth();
    public class ImagePanel
           ImgNtext it = new ImgNtext();
           JScrollPane sp;
           public ImagePanel() {
                     JFrame jf = new JFrame();
                     jf.setSize(1000,1000);
                     scp = new                JScrollPane(it,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
                     jf.getContentPane().add(scp);
                     jf.setVisible(true);
              public static void main(String s[]){
                   ImagePanel img = new ImagePanel();
    }

Maybe you are looking for