JAVA Frame problem

Hi,
I hav a problem in JAVA. I have a main frame. This has an internal
frame as its compnent. The size(height) of internal frame is more
than the main frame. I want the a to vertically scroll in main frame
to see the entire internal frame.
     The following code i tried with JSCrollPane gives me only
horizontall scrolling , so i can see entire width, but no verticall
scroll to see entire height of internal frame.
     Can u solve this problem.
Bye,
Pradeep
import java.awt.*;
import javax.swing.*;
public class Main extends JFrame
     JInternalFrame jInternal;
     JScrollPane jPane;
     Main()
          jInternal = new JInternalFrame();
          jInternal.setSize(200,600);//Internal Frame height bigger
          jPane = new JScrollPane(jInternal);
          getContentPane().add(jPane);
          setSize(200,200);//Frame height smaller
          jInternal.show();
     public static void main(String a[])
          Main m = new Main();
          m.show();     

Hi.. This might help:
JScrollPane jPane;
jPane = new JScrollPane(jInternal,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
U can change those constants so that it shows the scrollbars at all time.. Now they only appear when needed..

Similar Messages

  • Urgent!Java Frame Cutting according to non-rectangular image (Transparency

    Urgent-Java Frame Cutting according to non-rectangular image (CrossPlatform - Transparency)
    hi, i want to make the frame transparent in order to make a skin like Windows Media Player . skin is non-rectangular how should i make the frame transparent i am using the JWindow as the container. Plz guide me any idea. as an example i have a JWindow i put a non-rectangular image on it via Jlabel . now i want to make the edges of JWindow outside the boundery of the image transparent ... so that my frame seems like a non-rectanguar image . How i do that? But i need a cross platform kinna thing in java especially for windows/mac/linux
    PaulFMendler :: thanks for ur help i looked at the code but it seems to be windows dependent. i need cross-platform way of producing abt effects. please contact me even on my email >> [email protected]
    Waiting ......

    Check out the link shown below:
    http://forum.java.sun.com/thread.jsp?forum=4&thread=391403
    The posted code has slight problem when moving the JWindow around but you can get a pretty good idea on what has to be done.
    ;o)
    V.V.

  • Move Java Frame into Windows taskbar notification area (system tray)?

    Hi,
    I was wondering if anyone has written a service-like application in Java running (and appearing) in the Windows "taskbar notification area", instead of running in the convential Windows taskbar.
    I'm able to add an icon to the taskbar notification area (frequently errorneous called as the 'system tray') by using some native code that uses win32 Shell_NotifyIcon(.. , ..). However, I'm not able to 'couple' the window (i.e. the Java frame) to the new icon in the taskbar.
    My icon is shown in the area AND the frame is shown as an application in the taskbar... I would like to 'remove' my Java application from the taskbar and place it 'as an icon' in the taskbar notification area.
    Has anyone had experience with a similar problem?
    Many thanks!
    Jasper

    If all you need is to make the frame not visible in the taskbar as well than why don't you activate the hide() method? cature the minimize event and activate the frame.hide(); method. And in the system tray make the frame visible by frame.show();

  • How can  we see the desktop through a java frame by using JNI?

    How to make a java frame transparent( so that we can see the desktop through it) by JNI? I have seen some code to take a snapshot of the desktop. But is there any code so that the desktop is fully or partially visible through a frame?
    laks

    Please take your time to write full words: "you" instead of "u", "your" instead of "ur". It makes your posts a lot easier to read, especially for those of us who don't have English as their native language.
    You can not really "modify" the behaviour of a method by using a proxy, but you can create a proxy, direct all but one method to the original method and provide a separate implementation for the target method.
    This way you'll have two objects with the same interface (not only in the Java sense, but all methods look the same), but differing behaviour: the original object and the proxy.
    Now if you pass around the proxy instead of the original object, then it'll look as if you changed the behaviour of your object.

  • How to embed an external player in a java frame?

    Hello
    I want to use virtual dub player ( which has the capability of playing the video frame by frame and also normally) for some analysis of videos. But I want to embed the player in a java frame and draw some lines on the video. How can i embed the virtual dub player in a java frame?
    laks

    Look at:
    Slight oversight in the Concepts guide regarding external tables
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref777

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • DISPLAY SPATIAL DATA USING JDBC ON A JAVA FRAME

    I am trying to set up some spatial data and need help in getting some sample
    code for displaying the data on a Java Frame using JDBC.
    The shapes I am setting up are simple polygons, lines, circles. I was going
    through the samples in the demo directory under $ORACLE_HOME/md/demo/examples, but could not find any JDBC
    I would really appreciate if you can point me towards some sample code and any other spatial resources.
    Madhukar

    Here you go. It uses JDBC to fetch geoms, convert them into Java JGeometry objects, which then create Java2D shapes (these are functions of the public sdoapi.jar library). It then uses some class in the sdovis.jar library (the rendering engine of MapViewer) to setup the necessary viewport transform. If you know how to setup the viewport transform, then you dont even need sdovis. sdovis.jar is found in an deployed MapViewer's WEB-INF/lib directory. Or you can extract it from the mapviewer.ear's web.war file.
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import oracle.jdbc.OracleDriver;
    import oracle.sdovis.*;
    import oracle.sdovis.style.*;
    import oracle.sdovis.util.*;
    import oracle.spatial.geometry.JGeometry;
    import oracle.sql.STRUCT;
    * A very simple program that shows stuff from db in a JFrame
    * <p>
    public class tilsvgui2 extends JFrame
      final static int mapWidth  = 640;
      final static int mapHeight = 480;
      static JSDOGeometry geom = null;
      public tilsvgui2()
        setSize(mapWidth+40, mapHeight+40);
                    setVisible(true);
        this.addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(WindowEvent e) { System.exit(0); }
            public void paint(Graphics g)
                    super.paint(g);
        int w = this.getWidth(), h = this.getHeight();
        Insets inset = this.getInsets();
        double[] mbr = geom.getMBR();
        //from sdovis; it will setup the viewport transform
        XFViewPort xfp = new XFViewPort();
        xfp.setDeviceView(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        xfp.setDataView(mbr[0], mbr[1], mbr[2], mbr[3]);
        AffineTransform af = xfp.getAffineTransform();    //get the viewport transform
        Shape shp = geom.createShape(af);    //create a proper shape that fits the viewport
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.red);
        g2.drawRect(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        //draw the shape itself
        g2.setColor(Color.blue);
        g2.draw(shp);
      public static void getStuff() throws Exception
        System.out.println("Loading geometry...");
        Connection conn = getConnection("mapsrus.us.oracle.com", "1521", "orcl", "scott", "tiger");
        Statement  stmt = conn.createStatement();
        ResultSet  rset = stmt.executeQuery("select geom, totpop from counties where county='Merrimack' and state_abrv='NH'");
        while(rset.next())
          STRUCT st = (STRUCT) rset.getObject(1);
          geom = JSDOGeometry.loadFromDB(st);
          int population = rset.getInt(2);
          break; //displaying only the first geometry
        rset.close();
        stmt.close();
        conn.close();
      private static Connection getConnection(String host,
                                              String port,
                                              String sid,
                                              String username,
                                              String password)
        throws SQLException
        String thinConn = "jdbc:oracle:thin:@"+host+":"+port+":"+sid;
        Driver d = new OracleDriver();
        Connection conn = DriverManager.getConnection(thinConn,username,password);
        conn.setAutoCommit(false);
        return conn;
      public static void main(String[] args)
        try{
          getStuff();
        }catch(Exception e)
          e.printStackTrace(System.err);
        new tilsvgui2();
    }

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • Attaching window system tray icon events to java frame

    I need to bring java frame to front on an event with the icon placed in the system tray. Like if I click the mouse on it.. the frame should come to front.
    Any body who can help, I will really appreciate.
    Thanks in advance
    Zeeshan

    I am very interested in implementing just such a thing with my Java application. I am in the starting phases of this project and ran across your post in my search for info.
    How much do you already have implemented? I.E., can you display the icon but are just having trouble catching the events for when the icon is clicked? Or do you not even have the ability to display the icon yet? I have found the Windows documentation on the MSDN site for the shell function Shell_NotifyIcon(), which is what we want to use but I have not begun any attempts to use it yet.
    If you (or anyone else) have any info or have had any success at all with this yet, I would be very interested in hearing how it works. I'll be happy to share any info I find, when/if I get that far.
    Thanks,
    j

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • How to create sql database using java frame or appelet?

    hi ! i am working on database project i want to create a database using java frame or applet where it asks user to select the location for database to be created , after user have specified the path then the programs creates the database, again i want that database to be read and write by another frame or applet but as user select the path how do i make the connectivity. i just have basic knowledge on java. please give me idea how can i process further.
    thanks a lot

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • Insert windows gui  to java Frame?

    Hello exist any method or object for insert 'windows gui program' in a java Frame ?
    I need to launch an windows gui application from a java program .
    Thanks

    nturri wrote:
    Hello exist any method or object for insert 'windows gui program' in a java Frame ?That doesn't make sense.     
    I need to launch an windows gui application from a java program .[http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String)]
    ThanksYou're welcome.

  • Premiere Elements 7 - When play my work frame problems occur. codec issues?

    Hello,
    I use Premiere Elements 7 to edit my videos; however, recently I have found that most of the videos I add to my work shows a frame problem every time I play. I am not so familiar with the terms but I will try my best to explain how it happens.
    1. I open a new project
    2. Add a video (usually avi format)
    3. I play the video whitout editing.
    4. I see that after every 5 frames there is a frozen frame (like a dublicate of the 5th frame)
    It results me to cut my video in every 5 frames to get rid of the frozen frame and it takes a lot of time.
    What would be causing that? When I play the video with my media players it shows perfectly but when I add it to Premiere Elements 7 to edit, this is what happens.
    I also see that there are multiple fddshow icons on the right bottom of my screen.
    I assume there is something wrong with the codecs. In that case, what would be the best codec to have in order to edit my videos on PE7?
    What do you suggest I do?
    Thank you in advance.

    Dear Bill,
    I have formated my computer and reinstalled my operating system Vista Home 32 bit. Then I switched from PRE7 to PRE8.
    This is my computer info below;
    CPU Türü QuadCore Intel Core 2 Quad Q9300, 2500 MHz
    4GB RAM
    ATI Radeon HD 3600 Series 512 MB
    I have AVC Core 2.0.0 codec, NVIDIA PureVideo codec for MPEG, K-lite MEga codecs installed as they are-without any configuration.
    Gspot still shows Xvid codec XviD ISO MPEG-4.
    File Length Correct
    Multipart OpenDML AVI (2 parts)
    (69639 frames in first part, 2663 frames follow)
    Interleave: 1 vid frame (40 ms), preload=504
    Audio frames: Split across interleaves
    [JUNK] VirtualDub
    [JUNK] MPEG2 build 24586/release
    [ISFT] VirtualDubMod 1.5.4.1 (build 2178/release)
    [USER] XviD0050
    So I assume Xvid was used for this file. Considering that what would you reccomend me to do in order to view this file and be able to edit on PRE8?

Maybe you are looking for

  • Using Apple TV as display for MacBook

    Is there any way for me to use my Apple TV to display what I see on my macBook wirelessly to my flat screen TV? I have a 1TB Time Capsule as well if that helps.

  • How to get page totals at the end of the report in BI Publisher

    I am using BI Publisher 10.3 and using Ms-Word template builder to design the report and I want to implement totals for some columns (like page totals) ... can anyone let me know how to go about this Thanks

  • Set Properties Information in the Filesystem

    Hi, I am working on a program, that is reading the properties of the files in my Windows NT Fillsystem return them and save the chosen attributes in a array. I�m acutally doing this in JavaScript with the command "GetDetailsOf()". Thats works very fi

  • What happened to my N82's screen?

    I recently replaced the screen on my N82, I bought an official Nokia OEM screen, and now a few months later the top 1/3 of my screen has problems. Like fine black lines across the top of the screen. I can still read the screen but it is a bit difficu

  • I want to learn Flex in Flash Build 4.7!!!

    Can someone point me in the direction of a tutorial, or book on learning in Flash Builder 4.7?  If one even exsists?  All I can find is resources to learn in "Design Mode" which was discontinued in 4.7.  I REALLY don't want to have to figure out how