How to prevent displaying outer rectangle of JscrollPane

HI All,
I want prevent the displaying JSrollPane outer rectanlge means no outer rectangle formed JSrollPane should be displayed
below is the code, if the code is run then Rectagle will appear which is title fitted to JScrollPane.
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
public class Sample extends JFrame
     private static final long serialVersionUID = 1L;
     public Sample()
          Dimension size = new Dimension(
               150, 150);
          Dimension FRAME_SIZE = new Dimension(
               700, 500);
          setLocation(size.width, size.height);
          setSize(FRAME_SIZE);
          setBackground(Color.WHITE);
          setTitle("JFrame ");
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JPanel panel = new JPanel();
          JScrollPane sp = new JScrollPane(
               panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
               JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
          sp.setBounds(new Rectangle(
               10, 10, 400, 400));
          this.setLayout(null);
          super.getContentPane().add(sp);
     public static void main(String[] args)
          JFrame frame = new Sample();
          frame.setVisible(true);
}any helps arround this will deeply appreciated.
Thanks
Dorairaj M

Yes I realized about the solution
by setting empty border (BorderFactory.createEmptyBorder())
Thanks
Dorairaj M

Similar Messages

  • How to prevent arrayindex out of bounds exception while unziping the files

    hi all ,
    i am new to java.Can any body help me to solve my problem.here is my problem.
    here i am trying to unzip a ziped file. but i am getting arrayindex out of bounds exception at line no 12 (args[0]), my quesion is to how to prevent arrayindex out of bounds exception ? please give me clear explanation.
    public class UnZip2 {
    static final int BUFFER = 2048;
    public static void main (String args[]) {
    try {
    BufferedOutputStream dest = null;
    BufferedInputStream is = null;
    ZipEntry entry;
    ZipFile zipfile = new ZipFile(args[0]);
    Enumeration e = zipfile.entries();
    while(e.hasMoreElements()) {
    entry = (ZipEntry) e.nextElement();
    System.out.println("Extracting: " +entry);
    is = new BufferedInputStream
    (zipfile.getInputStream(entry));
    int count;
    byte data[] = new byte[BUFFER];
    FileOutputStream fos = new
    FileOutputStream(entry.getName());
    dest = new
    BufferedOutputStream(fos, BUFFER);
    while ((count = is.read(data, 0, BUFFER))
    != -1) {
    dest.write(data, 0, count);
    dest.flush();
    dest.close();
    is.close();
    } catch(Exception e) {
    e.printStackTrace();
    }

    how you run it?
    java Unzip2?
    args[0] refer to first parameter in run command, so u should run it by giving a parameter. eg:
    java Unzip2 someFile.zip

  • How to prevent flushing out the value in Select one choice on page refresh

    Hi All,
    I am using Jdeveloper 11.1.1.4.0. In my page fragment I am using select one choice ADF component. I have a requirement that unless one fills all details on 1st fragment he/she cant move to next fragment.
    So validations are there to check that mandatory fields filled or not. If not than I am showing message to fill the mandatory fields when user press on "Review " Button.
    But the value in select one choice is getting cleared while other input values like date fields or input text are not(The input information stored in static variables)
    How can I prevent flushing out of select one choice value .
    Thanx
    kanika

    Kanika,
    You don't have value property set due to which the selected value doesn't get stored and looses its value on refresh.
    When you drop attribute as select one choice on page, the value property get bounded to some value, did you remove it intentionally?
    If so, can you try keeping the property and see if you see the intended behavior?
    Sireesha

  • How to prevent display in scientific notation

    I want to convert a large double value to a string,
    but when the value is greater than 10000000 , it will display in
    scientific notation , such as 3.435E8
    However, how can I convert it automatically to 343500000 because
    there is an interface program which do not accept the scientific
    notation format
    Thanks in advanced

    Start here: http://java.sun.com/j2se/1.4/docs/api/java/text/NumberFormat.html

  • How to prevent display color option settings from disappearing after a restart of Firefox?

    I like to display specific text, background and link colors overriding pages' defaults; that info disappears almost after every Firefox restart. These settings are set in: Firefox>Options>Options>Content>Colors and having to reset them almost every time I start F is a pain.
    An ideal solution would be to allow a user to save their color picks as a separate "theme". I would then prefer to have 3 such saved themes that would be easy to switch at a push of a button:
    1. Light text on dark background (dark screen, less contrast) for a dark room;
    2. Lighter text on dark background (dark screen, more contrast) for a bright room;
    3. Firefox default.
    Finally, replacing a color palate with few colors with a color wheel from OS would be ideal and relatively simple to implement.
    This may or may not be related but preferred magnification of text on each individual page is also often lost (reset to default).

    See if the following article helps.
    * [[How to fix preferences that won't save]]
    Overriding web site colors may not be good idea because it also gets rid of background images. Some sites set background images for certain web page elements to display information that's crucial to using the site (like text for buttons).
    You can use the Stylish add-on to manage user styles that change the appearance of web pages in various ways. You can click the Stylish toolbar icon and enable or disable styles that are applied to the current page.
    # Install Stylish and restart Firefox when prompted.
    #* https://addons.mozilla.org/firefox/addon/stylish/
    # Click the ≡ Menu Button and choose Add-ons.
    # In the Add-ons Manager, click User Styles on the left.
    # Click the Write New Style button at the top. Paste the following in the text box, give the style a name, then click the Save button.
    <pre><nowiki>
    @-moz-document url-prefix("http://"), url-prefix("https://") {
    /* Dark background and light text. For more color names, see http://www.w3schools.com/HTML/html_colornames.asp */
    * { background-color: rgb(20,20,20) !important; color: whitesmoke !important; }
    a:link { color: royalblue !important; }
    a:visited { color: blue !important; }
    a:hover { color: lightblue !important; }
    a:active { color: red !important; }
    }</nowiki></pre>
    <pre><nowiki>
    @-moz-document url-prefix("http://"), url-prefix("https://") {
    /* Light background and dark text. For more color names, see http://www.w3schools.com/HTML/html_colornames.asp */
    * { background-color: whitesmoke !important; color: rgb(20,20,20) !important; }
    a:link { color: royalblue !important; }
    a:visited { color: blue !important; }
    a:hover { color: dodgerblue !important; }
    a:active { color: red !important; }
    }</nowiki></pre>
    You can install the Rainbowpicker add-on to choose any color everywhere in the Firefox interface (like Options/Preferences - Content - Colors).
    * https://addons.mozilla.org/firefox/addon/rainbowpicker/

  • How to prevent displaying un-corrected image during "Loading..." phase ?

    Is there an option for securely
    not displaying the un-corrected image ?
    (while browsing a large number of images - cache not a real option)
    In my not-so-slow system this ruins my
    personal touch secrets ( ;-) ) .
    Everyone can see my cropping/light adjustments etc.
    Am I alone ?

    Thanks Ian ... a pair of (transparent) glasses and a good bottle might also help !
    As I tried to explain
    preview cache can be huge (I didn't try to copy it from main system to demo laptop)
    and might not guarantee
    that an image will not be displayed "uncorrected".
    I'd prefer a blank placeholder during that "Loading..." phase.Personal choice.
    Would that be a bad idea ?
    BTW my workaround is an export+catalog but for me it defeats
    all the Lightroom DAM beauty.

  • Importing cd's and suddenly can't see the recently added folder, have been unable to figure out how to re-display it, know the songs are going somewhere

    Was importing cd's and suddenly can't see recently added folder, been unable to figure out how to re-display it, know the songs are going somewhere

    See Restore Original Smart Playlists.
    tt2

  • How to prevent a text in script from displaying if its value is zero

    Dear all,
    How to prevent a text in script from displaying if its value is zero
    for eg   Price  = 0.00
    if price is 0 it should'nt appear in output.
    I tried with    if price ne 0.
                       price = &price&
                        endif.
    but it's not working.
    Regards
    Raj
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 20, 2009 8:59 AM

    Hello Nagaraju,
                           What you were doing is partially right.
    The correct format to write in the script is as follows :
    /:  if &PRICE& ne 0.
      &PRICE&
    /:  endif.
    This should work. Let me know how it goes.
    Nayan

  • Acrobat xi - RE: Add sound icon- skin displayed is a 'blank white box' until it is clicked to activate it- can you lock skin to display before its activated so that in a print run the skin shows up (ie the controls-or any kind of greyed out rectangle, lik

    Hi,
    Acrobat xi - RE: Add sound icon- skin displayed is a 'blank white box' until it is clicked to activate it- can you lock skin to display before its activated so that in a print run the skin shows up (ie the controls-or any kind of greyed out rectangle, like video controls before 1st activation) and not the blank white box- if no, I guess I have to activate all sound icons before doing a print run?thanks)).

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • I have an iPhone 4S that is a replacement of a defective 4s and it shows over 3Gb of data backed up in the cloud from my old 4s. How can I find out what is in this backup? It is preventing me from backing up my new 4s to the cloud due to the amt of data.

    I have an iPhone 4S that is a replacement of a defective 4s. When I activated the newer phone, I believe I transferred over everything except pictures (had multiple failures trying to backup and restore). Now the phone shows over 3Gb of data backed up in the cloud from my old 4s. How can I find out what is in this backup? It is preventing me from backing up my new 4s to the cloud due to the amt of data. It may be duplicated info that I don't need or I may want to archive the backup or parts of it like pictures.

    You can not access the backup directly.
    Did you restore your replacement from this backup?
    If so then you already have everything in the backup on your device.
    If not, you can wipe the device and restore from this backup:
    Settings > General > Reset > Erase All Content & Settings
    What is it you are worried about losing that isn't already on your current device?

  • My Ipad is locked and display a message that says " The Ipad hasnt been backed up in 2 weeks...........connected to wifi".  How do I come out of it?

    My Ipad is locked and display a message that says " The Ipad hasnt been backed up in 2 weeks...........connected to wifi".  How do I come out of it?

    Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • How do i prevent display of a particular column in ALV

    How do i prevent display of a particular column
    of a structure in ALV

    Hi Serdar,
    Please do let us know the link , as soon as your code sample is put in sdn.sap.com.
    I request the <b>veteran members</b> of this forum to <b>contribute to WebLogs</b> or <b>code samples</b>, since over the time, the same questions will be asked and instead of repeating the answers, we can direct them to Weblogs or Code Samples.
    There is an ABAP FAQ present in this site, which has given insight to so many things, that I have not even considered remotely possible.
    As seen today, there was a useful piece of code posted. Instead of posting the code in the forum, you can create it as a weblog and post it there.
    Regards,
    Subramanian V.

  • Our daughter figured out on her own how to delete songs and apps from her IPAD2. Her parents would like to know how to delete such files and then how to prevent our daughter from doing it.

    Our daughter figured out on her own how to delete songs and apps from her IPAD2. Drives us crazy since we continually have to reload these files. Her parents would like to know
    1. how she did it (delete files) and
    2. how to prevent her from deleting files in the future.

    http://support.apple.com/kb/ht4213

  • When lock My MacBook under Maverick i want to prevent Display sleep. How to to this?

    When lock My MacBook under Maverick i want to prevent Display sleep. How to to this?

    I agree this is works when MacBook is locking after some time. Once I press keyboard shortcut to lock, Display also is set to sleeping mode, So question is how to prevent this in this case?
    Thank you!

  • Confused about how to display a rectangle on JFrame

    i'm a little confused about how to display a rectangle on a jframe.
    I know there is a class called Rectangle. is there a way to use it to display a rectangle on a JFrame? i couldn't find a way to do that.
    i found a way to display a rectangle in the internet:
    CODE:
    public class RectangleFrame extends JFrame {
        public RectangleFrame() {
            super("My Rectangle");
            setSize(300,400);
            setLocation(300,300);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            JButton button = new JButton("Button");
            JPanel panel = new JPanel();
            panel.add(button);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(new Rect(), BorderLayout.CENTER);
            getContentPane().add(panel, BorderLayout.SOUTH);       
            setVisible(true);
        public static void main(String[] args) {
            new RectangleFrame();
    public class Rect extends JComponent {
        public void paint(Graphics g) {
            g.drawRect(50,50,200,200);
    }is this the only way to do that? isn't there an easier way? do i have to write this new class Rect i wrote?
    i don't really know how this Rect class i wrote works. could someone explain?
    then another question: can i put a rectangle on a JPanel or do i have to add it directly onto the ContentPane as i did above?
    i hope everything i asked is clear enough.
    thanks for your effort.

    Take a look at the 2D graphics tutorial:
    http://java.sun.com/docs/books/tutorial/2d/index.html

Maybe you are looking for

  • "Help" is not working.

    Followed the other suggestions of deleting the 2 help plist files, but Help is still blank. Just got iMovie 11 and would like to use Help. When I type something in the search box, it comes up with lots of things, but not anything to do with iMovie 11

  • Can't Import CD to iTunes 8

    I haven't seen this particular issue detailed yet. When I attempt to import a CD to the new itunes I get an error telling me I don't have sufficient permissions to write to my music folder. The dialogue box indicates that I should check my Music fold

  • IPhoto 08 will not open any events since 9.1.5 auto-upgrade. Can anyone help?

    I had an auto-update on my Mac OSX 10.5.8 for iPhoto program to Version 9.1.5 on July 14th. Since then I cannot open any events in iphoto when I double click on them. I can see the other pictures in each event but that's all. IPhoto only lets me scan

  • External Hard drive will no longer mount

    I just got a new macbook pro refurbished, and I connected my external hard drive to it and it worked great the first time. I came back to do that same today and now i cannot get any hard drives to show up on my computer in the desktop, then checked d

  • 30,60,90 Days Totals in sql query

    Hi All, Here I  have written a query to find the total for 30Days to calculate costs.... These 30Days Amount will be populated into another table based on joins. I know we can do by case in the final update but lot of logic is going into temptables1