Removing Border from a JtextField

Hi all
how do i remove the border surrounding the JTExtfield in my applet (using jdk1.3)
Thank You

A brief browsing of the Java documentation (which I always keep close at hand) indicates that JComponent has the setBorder() method. A website mentioned in the setBorder part gives this example (I haven't tested it):
nameOfTextField.setBorder(BorderFactory.createEmptyBorder());Here is the site I extracted it from:
http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html

Similar Messages

  • Removing border from JButton

    * This is a crosspost, hope you don't mind. The earlier post I made was in the wrong forum and in the wrong thread.. *
    I'm trying to remove the border from a bunch of JButtons.
    My code adds custom actions to a custom JToolbar. The code responsible for this looks like this:    JButton button = this.add(action);
        //button.setBorder(new EmptyBorder(1, 2, 1, 2));
        button.setBorder(null);I've tried both lines, and both work and don't work at the same time. In one panel it works but in five others it doesn't. The only difference I see between these two groups is that the panel that works uses a GroupLayout and the other panels use a BorderLayout.
    Also, I'm trying to create an onMouseOver effect similar (well, exactely the same actually) as is used in Eclipse. When the users mouse hover over the button the button should be given a border, when it is not the border should be gone.
    Any help on these issues would be appreciated,
    Jurgen

    This might also help if you want to make a button out of a Componet
    package tjacobs.ui.drag;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.FlowLayout;
    import java.awt.Graphics;
    import java.awt.event.ActionEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import tjacobs.ui.swing_ex.JLabel;
    import tjacobs.ui.util.RandomColor;
    public class Buttonize extends MouseAdapter {
         private Component c;
         private Action a;
         private static int sNumClicks = 2;
         private int numClicks;
         private boolean showClicks = false;
         private Buttonize(Component c, Action a) {
              this.c = c;
              this.a = a;
              numClicks = sNumClicks;
              c.addMouseListener(this);
          * Main interface to Buttonize. Makes a component double-clickable
          * @param c Component to listen for clicks on. Not null
          * @param a Action to be run when the click count is hit. Not null
          * @return
         public static Buttonize MakeButton(Component c, Action a) {
              if (c == null || a == null) throw new IllegalArgumentException("Invalid Parameters");
              Buttonize b = new Buttonize(c, a);
              return b;
         public void mouseClicked(MouseEvent me) {
              if (TEST) System.out.println("clicked");
              if (me.getClickCount() % numClicks == 0) {
                   int modifiers = me.getModifiers() | me.getModifiersEx();
                   //if (ev == null) {
                        //Object source, int id, String command, long when, int modifiers
                   Component src = (me.getSource() instanceof Component) ? (Component)me.getSource() : c;
                   ActionEvent ev = new ActionEvent(me.getSource(), me.getID(), src.getName(), me.getWhen(), modifiers);
                   a.actionPerformed(ev);
         private static final boolean TEST = false;
         public void mousePressed(MouseEvent me) {
              if (TEST)
              System.out.println("pressed" + me.getPoint());
              if (showClicks) {
                   Component c = me.getSource() instanceof Component ? (Component) me.getSource() : this.c;
                   Graphics g = c.getGraphics();
                   g.setXORMode(Color.BLACK);
                   c.paint(g);
         public void mouseReleased(MouseEvent me) {
              if (TEST) System.out.println("released" + me.getPoint());
              if (showClicks) {
                   Component c = me.getSource() instanceof Component ? (Component) me.getSource() : this.c;
                   c.repaint();
         public void setClicks(int clicks) {
              numClicks = clicks;
         public int getClicks() {
              return numClicks;
         public static void setDefaultClicks(int clicks) {
              sNumClicks = clicks;
         public static int getDefaultClicks() {
              return sNumClicks;
         public void setShowClicks(boolean b) {
              showClicks = b;
         public boolean getShowClicks() {
              return showClicks;
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              JLabel hic = new JLabel("Hic"), haec = new JLabel("Haec"), hoc = new JLabel("Hoc");
              Action a = new AbstractAction() {
                   public void actionPerformed(ActionEvent ae) {
                        System.out.println(ae.getActionCommand());
                        RandomColor rc = new RandomColor();
                        Color c = rc.getRandomROYGBV();
                        ((JLabel)ae.getSource()).setForeground(c);
              JPanel jp = new JPanel(new FlowLayout());
              hic.setName("Hic");
              haec.setName("Haec");
              hoc.setName("Hoc");
              jp.add(hic);
              jp.add(haec);
              jp.add(hoc);
              MakeButton(hic, a);
              Buttonize b = MakeButton(haec, a);
              b.setShowClicks(true);
              //MakeButton(hoc, a);
              hoc.addMouseListener(b);
              JFrame jf = new JFrame("Buttonize Test");
              jf.setContentPane(jp);
              jf.setBounds(100,100,200,100);
              jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf.setVisible(true);
    }

  • Remove border from last item in ul, li?

    Hello! I am using this css style for a list.
    ul.listright { border-left:1px solid #EDEDED; padding-top:4px; }
    ul.listright li { border-bottom:1px solid #D9D9D9; margin:0 0 -1px; padding:1.1em 0; }
    I am trying to remove the border from the li on the bottom. I tried:
    ul.listright li last { border-bottom:medium none; }
    ..but that didn't do anything. What am I doing wrong?

    nemci7v wrote:
    Hello! I am using this css style for a list.
    ul.listright { border-left:1px solid #EDEDED; padding-top:4px; }
    ul.listright li { border-bottom:1px solid #D9D9D9; margin:0 0 -1px; padding:1.1em 0; }
    I am trying to remove the border from the li on the bottom. I tried:
    ul.listright li last { border-bottom:medium none; }
    ..but that didn't do anything. What am I doing wrong?
    In cases where you need to remove the border on one element its faster and simpler to just go into code view and use some inline css styling as below:
    <ul class="listright">
    <li>Some text</li>
    <li>Some text</li>
    <li style="border: none;">Some text</li>
    </ul>

  • Remove border from HTML portlet

    Hii,
    When i am adding HTML portlet then a border is coming automatically. How to remove this border.

    Hi,
    The Rendering of the Portlet depends on the Region too - you can have a look at the "Edit Defaults" ( the Pencil Icon ) link for the Region where the Portlet is located. You can uncheck the " Show Portlet Borders " ( or, even " Show Portlet Headers " ).
    Regards,
    Sandeep

  • Need to remove border from stock image...

    I am very very new to using Illustrator10 and I have a stock image that I bought online and am trying to make some adjustments to it.  I've been successful so far with my changes except for a thin black line border that was around the image when I opened it in Illustrator.  I can't even seem to click on it or highlight it at all and therefore I have no idea how to delete it.  Any help would be greatly appreciate! Thanks!

    The artwork has no printable border.
    What you are seeing is the artboard bounds. You can prove it to yourself by printing the document (print to PDF if you don't want to waste paper) or by changing the artboard size via File | Document Setup.
    The artwork does happen to have a rectangle that exactly coincides with the artboard size. It provides the taupish background. If you select it and look at the appearance palette, you'll see it has a fill but no stroke.
    {Beaten to the punch by Larry.}

  • How to remove the border from an AWT Component (specifically a ScrollPane)

    I've been trying to remove the border from an AWT ScrollPane, but having no luck.
    I've tried setting the bounds on the ScrollPane to get rid of the border:
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setBounds(-2, -2, getSize().width+4, getSize().height+4);
    I've also tried overwriting the paint method of the ScrollPane but it didn't draw anything:
    private class CustomScrollPane extends ScrollPane
         public void paint(Graphics p_g)
              super.paint(p_g);
              Graphics2D g2 = (Graphics2D)p_g.create();
              g2.setColor(Color.MAGENTA);     //tried magenta so I could easily see it
              g2.drawLine(0, 0, 0, getSize().width);
    Is there anything else I should try? (I wish AWT components had a setBorder method)

    Is there anything else I should try? (I wish AWT components had a setBorder method)Actually this probably isn't possible. One of the main drawbacks of AWT was that since everything is connected to peers, you can't actually draw over or customize the view of your AWT component.
    The only recommendation I might make would be that you could try creating Canvases around your ScrollPanel that draw over the border

  • Removing blue border from rollover image in cs6

    Have 14 sliced images. But only the images created for rollover have the blue border when I reveiw in the browser. Not sure how to remove them in Dreamweaver CS6
    Message was edited by: MrBotis

    Just to clarify, to remove borders from linked images, use this in your CSS:
    a img }
    border:none;
    Ouline serves a different purpose.  It's usually dotted and displays when the link is in focus, as when people tab through links with their keyboard.
    Jon, I know you know this. 
    Nancy O.

  • Remove red border from required fields

    Is there a way to remove the red border from required fields.?

    No, not the same error message that Acrobat issues. You'll have to do your own using JavaScript. The script would check each of the required fields and alert the user if anything was wrong, but you'd have to set up your own "Print" button on the form and convince your users to use it. But they can always choose not to use it and orint without going through the checking process.
    Even though there is a Document Will Print event that you can attach code to, there is no way to prevent printing in the event.

  • Removing keyword from multiple images at the same time

    None of the documented methods seem to work for me.
    1     Select all the images. Go to Metadata > Remove Keyword [my keyword] - the keyword is only removed from the image that is selected in the batch - i.e the one that has the yellow border round it to show it's the active image.
    2     Select all the images, enter [my keyword] in the Add Keyword field when Keyword Controls is visible and press Shift + Enter - does the same thing as 1 above (removes it from the active image only).
    3     Select all the images, Shift Click on the keyword that I have in my Keyword Controls in the Control Bar - does the same things as 1 above.
    So all these methods, which are supposed to work, do not work for me. The removal of the keyword is only applied to the image that has the yellow border showing it to be the currently active image in the selected batch - the remaining selected imaged still retain the keyword. I can remove it "one at a a time" but it would be great if I could find a solution as to why this isn't working.
    Any ideas?
    If it helps, I'm running Aperture 3.1.3 in OS X 10.6.8.
    thanks
    Alan

    Based on the frequency with which this trips up users, the Aperture team is going to have to add a much stronger visual indication that "Primary Only" is active.  Marching ants, anyone?  Or a pink selection marquee?
    At least in the Viewer when multiple Images are selected the thin white selection marquee is dropped when Primary Only is active.  There is no such change in the Browser.

  • Method or property to remove decorations from a control

    Hi folk,
    by program, I would like to remove (to make transparent) some decorations of a control (the 3d border of an Intensity Graph) before to save it on a png/jpg file.
    Do you know how to perform that task by method or property?
    Regard,
    Asper

    Dear Ben,
    thanks for your workaround suggestion.
    I already use the Get Image node, but I believe that this is not the right way. I would like to preserve all features like scales, scale labels etc. and strip out only the 3d border and other decorations.
    "slice and dice" the image is not possible because it would cut parts of scales. Now I am using the "Create Mask.vi" to delete the color that is associated with the border. This approach works not very well too.
    The 3d border has a color gradient and it is necessary to delete all colors associated to the 3d border gradient.
    Further the 3d border changes size and number of gradient colors with the zooming of the windows. Not last, the size of plot area changes with variation of the minimum and maximum of scale limits.
    Programmaticly is not so clear which points should be selected to detect the colors to mask.
    Any method or property to remove decorations from a control?
    Asper

  • How do i remove money from 1 itunes account to another ?

    How Do I Remove Money From One Itunes Account To Another ?

    See:  More Like This    To the right -->

  • I've had three laptops all connected to my itunes account, one was stolen, the other broke, how can I remove them from my itunes account?

    So, in three years, after getting an iphone and an apple account I've had to replace a laptop twice due to theft or damage. When I link my phone to my new computer, it asks me if I want to connect the computer with the phone and I say yes, but you can only have 5 devices connected to one account, since one was stolen, and the other laptop broke, how do I remove them from my account??

    De-authorise all, then authorise the one you still have.

  • How can we remove items from the VF04 list?

    We have a long list of items in VF04 that, for various reasons (some process related, some due to errors), are not to be billed. We have looked at applying filters to the list but there is nothing really suitable to hide these individual documents e.g. we could filter out some dates where none of the items on that date are to be billed but other dates have a mix of items we want to bill and others we don't.
    I have done a search of this forum but didn't find a previous topic with a quick and simple method to remove items from the list .
    Is there a method, other than billing them or sorting each issue individually, to permanently remove individual documents from the VF04 list?
    Thanks in advance for any help.
    David

    Hi,
    David,
    Download a list of Pending delivers doc form VF04.
    Paste the list in T.Code : VL09 (Delivery reversal) and reverse the delivery.
    Then go to T.Code: VL06G Select the list of deliveries that has been reversed, select/delete all un- wanted deliveries.
    This way you can remove all unwanted pending deliveries forn Billing due list (VF04).
    Thanks & Regards,
    R.Janakiraman

  • What steps do I take to give my husband my older IPAD w/o removing him from my Apple account?

    I recently bought a new IPAD2.  All personal data and APPS were transferred from my older IPAD to my new one at the time of purchase. I'd like to give my older IPAD to my husband w/o removing him from my Apple acct.  Apple's support does not provide instructions for my situation.  Does anyone have suggestions as to what steps I should take?

    What you might need to do depends upon how you want the old iPad to be for him.
    If he will be using your iTunes account for any purchases/downloads from the store then he can continue to be logged in with your account in Settings > iTunes & App Stores. If not then log out of your account by tapping on your id in there, and he can then log in with his own account - any apps and other store downloads that you leave on the iPad will remain tied to your account, so only your account will potentially be able to redownload them and/or download updates to your apps.
    To use his own account for Messages he can log out of your account via Settings > Messages > Send & Receive - tap on your id at the top of that screen and select 'sign out' on the popup. He can then log in with his account. Similarly for FaceTime : Settings > FaceTime (tap on your id on that screen). And (if he wants to back up his content to his own account) : Settings > iCloud > Sign Out
    If you want to remove all content from the old iPad so that he can start afresh with it, then Settings > iCloud > Sign Out, and then Settings > General > Reset > Erase All Content & Settings

  • How to remove Userscripts from Greasemonkey without enabling Greasemonkey? (I have deleted files from user/gm_scripts/ didn't help)

    I installed an addon named Chat Resizer, which is for Kongregate, restarted to finish the install and firefox would not open.
    Clicked it and clicked it nothing, Opened Task Manager, Ended the firefoxes and tried to open it again but nothing again.
    Started FF in safe mode, cannot remove chat resizer with greasemonkey disabled, trying to enable it to remove it firefox refuses to start.
    Uninstalled greasemonkey, FF works as normal, install it and it freezes once more.
    Removed files from user/appdata/roaming/mozilla/profile blah blah/gm_scripts which had files for all of my scripts in them,
    Firefox still won't start, uninstall greasemonkey, works again, install, doesnt work even with files for the scripts gone.
    Any more suggestions?

    Hello,
    I found this tutorial, i think must works:
    [http://ooiks.com/blog/mousehunt-autobot/install-uninstall-user-script-on-firefox How to Install and Unistall User Scripts Greasemonkey]

Maybe you are looking for

  • I have two itunes accounts and want to make them into one account.

    I have two itune accounts and would like to combined them to make one.  Is this possible and if so how can I do it?

  • Help!!! iphone 5 rear camera blurry after iOS 7.0.6 update.

    Help!!!! I just updated my iPhone 5 software to iOS 7.0.6. I realized that my rear camera became blurry. It won't focus even if I tap in the middle. There are no physical problems with the camera itself. I checked. Plus the camera is quite fine when

  • Sync Podcasts in ipod 40gb

    Hi everyone... I have a 40gb ipod and able to transfer my music and photo to my ipod with no problem. BUT sync podcasts do not work. i have tried different options in ITUNES 7.2 such as: All, all new ...., tried manually transfer, Also right click on

  • Get the approver for a purchase requisition

    Hello I am trying to retrieve who approved a purchase requisition. I have the PR number. Is there a bapi or FM returning this info. If not please let me know how to do that Thanks

  • Password for exchange refused

    I have carried a clean install of Lion - Have tired to set up my MS exchange account in Lion mail all goes well email address and accepted and server found. However the password box keeps appearing saying incorrect password. I have changed the passwo