Problem clearing a JTextArea

I know this may be something that is very obvious, but for some reason I cannot clear the text I have written to a JTextArea. I have tried removeAll(), I have tried selectAll() and then removeAll(), and some other things, but nothing seems to work. I would appreciate any advice that someone can give me! :) (Thanks in advance).

Sure, do that if you want to induce a compile time error.
Try setText("");

Similar Messages

  • Problem in updating jtextarea

    My requirement is, client has to sent string messages and server has to receive these messages and display it in jtextarea. In my code sending and receiving are done properly, but the problem is the jtextarea is not updated, it goes blank.
    I have attached the client and server files, can anyone solve my problem?
    Thanks in advance.
    //server file
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MessageCenter extends javax.swing.JFrame {
        public MessageCenter() {
            initComponents();
        private void initComponents() {
            jLabel1 = new JLabel();
            jScrollPane1 = new JScrollPane();
            jTextArea1 = new JTextArea();
            jPanel1 = new JPanel();
            jLabel5 = new JLabel();
            jLabel3 = new JLabel();
            jButton1 = new JButton();
            jButton2 = new JButton();
            jLabel2 = new JLabel();
            jLabel4 = new JLabel();
            menuBar = new JMenuBar();
            fileMenu = new JMenu();
            Start = new JMenuItem();
            jSeparator1 = new JSeparator();
            Stop = new JMenuItem();
            jSeparator2 = new JSeparator();
            Exit = new JMenuItem();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Message Center");
            setMaximizedBounds(new java.awt.Rectangle(0, 0, 560, 700));
            setBounds(0,0,600,700);
            setName("");
            jLabel1.setBackground(new java.awt.Color(255, 255, 255));
            jLabel1.setFont(new java.awt.Font("Georgia", 1, 24));
            jLabel1.setForeground(new java.awt.Color(34, 44, 106));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setText("Message Center");
            jLabel1.setIconTextGap(0);
            getContentPane().add(jLabel1, java.awt.BorderLayout.NORTH);
            jTextArea1.setColumns(20);
            jTextArea1.setFont(new java.awt.Font("Book Antiqua", 0, 12));
            jTextArea1.setLineWrap(true);
            jTextArea1.setRows(25);
            jTextArea1.setBorder(null);
            jScrollPane1.setViewportView(jTextArea1);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
            jPanel1.setLayout(new java.awt.GridLayout(1, 6, 10, 5));
            jPanel1.add(jLabel5);
            jPanel1.add(jLabel3);
            jButton1.setText("Start");
            jPanel1.add(jButton1);
            jButton2.setText("Stop");
            jPanel1.add(jButton2);
            jPanel1.add(jLabel2);
            jPanel1.add(jLabel4);
            getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);
            fileMenu.setText("File");
            Start.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    System.out.println("hello");
                    StartActionPerformed(evt);
            fileMenu.add(Start);
            fileMenu.add(jSeparator1);
            Stop.setText("Stop");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    StopActionPerformed(evt);
            fileMenu.add(Stop);
            fileMenu.add(jSeparator2);
            Exit.setText("Exit");
            fileMenu.add(Exit);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            pack();
    private void StartActionPerformed(java.awt.event.ActionEvent evt)  {
              try{
                        Server t=new Server(jTextArea1);
                        t.listenSocket();
              catch(Exception e)
              e.printStackTrace();
        private void StopActionPerformed(java.awt.event.ActionEvent evt) {
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MessageCenter().setVisible(true);
        private JMenuItem Exit;
        private JMenuItem Start;
        private JMenuItem Stop;
        private JMenu fileMenu;
        private JButton jButton1;
        private JButton jButton2;
        private JLabel jLabel1;
        private JLabel jLabel2;
        private JLabel jLabel3;
        private JLabel jLabel4;
        private JLabel jLabel5;
        private JPanel jPanel1;
        private JScrollPane jScrollPane1;
        private JSeparator jSeparator1;
        private JSeparator jSeparator2;
        public JTextArea jTextArea1;
        private JMenuBar menuBar;
    class ClientThread implements Runnable {
      private Socket client;
      JTextArea jt;
      ClientThread(Socket client,JTextArea jt) {
       this.client = client;
       this.jt=jt;
      public void run(){
        try{
               //DataInputStream dis= new DataInputStream(client.getInputStream());
                DataInputStream dis= new DataInputStream(new BufferedInputStream(client.getInputStream()));
               System.out.println("client connected");
               //BufferedReader dis = new BufferedReader(new InputStreamReader(s.getInputStream()));
                   String msg=null;
                   byte msg1[]=new byte[200];
                while(true)
                   try{
                   if(dis.available()>0)
                   dis.readFully(msg1,0,dis.available());
                 //  System.out.println("Msg is ==> "+new String(msg1));
                   new PrinterThread(jt,new String(msg1)).start();
                   msg1=new byte[200];
                   Thread.sleep(1000);
                      }catch (Exception e) {
                         System.out.println("Exception  ");
             } catch (IOException e) {
                         System.out.println("Exception occurred");
    class Server {
              JTextArea jt;
              public Server(JTextArea jt)
                   this.jt=jt;
              public void listenSocket() throws Exception
              ServerSocket ss=null;
              try{
              ss=new ServerSocket(8000);
              System.out.println("Server started");
             catch (IOException e) {
                         System.out.println("Exception");
                         System.exit(-1);
             while(true){
               ClientThread w;
               try{
            w = new ClientThread(ss.accept(),jt);
            Thread t = new Thread(w);
            t.start();
                catch (IOException e) {
            System.out.println("Accept failed: 8000");
           public static void main(String args[])throws Exception {
              /*Server t=new Server();
              t.listenSocket();*/
         class PrinterThread extends Thread
                public PrinterThread(JTextArea jt1,String msg)
                 jTextArea1 = jt1;
                 this.msg=msg;
                 System.out.println("PrinterThread constructor ");
                public void run()
                 try
                    Date today;
                    SimpleDateFormat formatter;
                    String output;
                     String pattern="dd.MM.yyyy '@' H:mm";
                    formatter = new SimpleDateFormat(pattern);
                    today = new Date();
                    output = formatter.format(today);
                        System.out.println(" "+output+"  "+msg+" \n");
                          jTextArea1.append(" "+output+"  "+msg+" \n");
                          jTextArea1.updateUI();
                             jTextArea1.revalidate();
    //                      JOptionPane.showMessageDialog(null,"hi");
                          //System.out.println("Get text "+jTextArea1.getText());
                 catch (Exception exception) {}
                private JComboBox combo;
                private JTextArea jTextArea1;
                String msg=null;
    //client.java
    import java.net.*;
    import java.io.*;
    import java.io.File;
    public class client {
           public static void main(String args[]) {
                   try {
                           Socket ss=new Socket(InetAddress.getLocalHost(),8000);
                           DataOutputStream dos=new DataOutputStream(ss.getOutputStream());
                           for(int i=1;i<100;i++){
                              if((i%2)==0)
                            dos.writeBytes("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,3233");
                              else
                            dos.writeBytes("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42");
                           Thread.sleep(5000);
                   catch(Exception e) {
                   e.printStackTrace();
                   System.out.println(" ");
    }

    You need to run your Server in a separate Thread.
    Right now its running in the GUI Event Thread.I created new thread for my server, now it's updating jtextarea.
    Thank you very much.

  • I still have a problem clearing history and i did select time range to Everything

    I still have a problem clearing history and i did select time range to "Everything". I tested using Internet explorer and I could clear the history there so its not a problem with the Xp secondary account. I even disabled the add ons in firefox and still get the same issue

    sorry, scratch this, the first post did enable me to find a solution, it was the signon.sqlite file that had become corrupted.
    As an interesting aside, this has also fixed the problem with using Xmarksspace which was giving me an "error 3" synchronising problem.
    Apologies for the tone of my previous posting, you did provide the information that enabled me to find a solution, thank you and sorry.
    Regards
    Crashhot

  • Problem in repainting jtextarea

    My requirement is, client has to sent string messages and server has to receive these messages and display it in jtextarea. In my code sending and receiving are done properly, but the problem is the jtextarea is not updated, it goes blank.
    I have attached the client and server files, can anyone solve my problem?
    Thanks in advance.
    //server file
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MessageCenter extends javax.swing.JFrame {
        public MessageCenter() {
            initComponents();
        private void initComponents() {
            jLabel1 = new JLabel();
            jScrollPane1 = new JScrollPane();
            jTextArea1 = new JTextArea();
            jPanel1 = new JPanel();
            jLabel5 = new JLabel();
            jLabel3 = new JLabel();
            jButton1 = new JButton();
            jButton2 = new JButton();
            jLabel2 = new JLabel();
            jLabel4 = new JLabel();
            menuBar = new JMenuBar();
            fileMenu = new JMenu();
            Start = new JMenuItem();
            jSeparator1 = new JSeparator();
            Stop = new JMenuItem();
            jSeparator2 = new JSeparator();
            Exit = new JMenuItem();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Message Center");
            setMaximizedBounds(new java.awt.Rectangle(0, 0, 560, 700));
            setBounds(0,0,600,700);
            setName("");
            jLabel1.setBackground(new java.awt.Color(255, 255, 255));
            jLabel1.setFont(new java.awt.Font("Georgia", 1, 24));
            jLabel1.setForeground(new java.awt.Color(34, 44, 106));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setText("Message Center");
            jLabel1.setIconTextGap(0);
            getContentPane().add(jLabel1, java.awt.BorderLayout.NORTH);
            jTextArea1.setColumns(20);
            jTextArea1.setFont(new java.awt.Font("Book Antiqua", 0, 12));
            jTextArea1.setLineWrap(true);
            jTextArea1.setRows(25);
            jTextArea1.setBorder(null);
            jScrollPane1.setViewportView(jTextArea1);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
            jPanel1.setLayout(new java.awt.GridLayout(1, 6, 10, 5));
            jPanel1.add(jLabel5);
            jPanel1.add(jLabel3);
            jButton1.setText("Start");
            jPanel1.add(jButton1);
            jButton2.setText("Stop");
            jPanel1.add(jButton2);
            jPanel1.add(jLabel2);
            jPanel1.add(jLabel4);
            getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);
            fileMenu.setText("File");
            Start.setText("Start");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    System.out.println("hello");
                    StartActionPerformed(evt);
            fileMenu.add(Start);
            fileMenu.add(jSeparator1);
            Stop.setText("Stop");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    StopActionPerformed(evt);
            fileMenu.add(Stop);
            fileMenu.add(jSeparator2);
            Exit.setText("Exit");
            fileMenu.add(Exit);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            pack();
    private void StartActionPerformed(java.awt.event.ActionEvent evt)  {
              try{
                        Server t=new Server(jTextArea1);
                        t.listenSocket();
              catch(Exception e)
              e.printStackTrace();
        private void StopActionPerformed(java.awt.event.ActionEvent evt) {
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MessageCenter().setVisible(true);
        private JMenuItem Exit;
        private JMenuItem Start;
        private JMenuItem Stop;
        private JMenu fileMenu;
        private JButton jButton1;
        private JButton jButton2;
        private JLabel jLabel1;
        private JLabel jLabel2;
        private JLabel jLabel3;
        private JLabel jLabel4;
        private JLabel jLabel5;
        private JPanel jPanel1;
        private JScrollPane jScrollPane1;
        private JSeparator jSeparator1;
        private JSeparator jSeparator2;
        public JTextArea jTextArea1;
        private JMenuBar menuBar;
    class ClientThread implements Runnable {
      private Socket client;
      JTextArea jt;
      ClientThread(Socket client,JTextArea jt) {
       this.client = client;
       this.jt=jt;
      public void run(){
        try{
               //DataInputStream dis= new DataInputStream(client.getInputStream());
                DataInputStream dis= new DataInputStream(new BufferedInputStream(client.getInputStream()));
               System.out.println("client connected");
               //BufferedReader dis = new BufferedReader(new InputStreamReader(s.getInputStream()));
                   String msg=null;
                   byte msg1[]=new byte[200];
                while(true)
                   try{
                   if(dis.available()>0)
                   dis.readFully(msg1,0,dis.available());
                 //  System.out.println("Msg is ==> "+new String(msg1));
                   new PrinterThread(jt,new String(msg1)).start();
                   msg1=new byte[200];
                   Thread.sleep(1000);
                      }catch (Exception e) {
                         System.out.println("Exception  ");
             } catch (IOException e) {
                         System.out.println("Exception occurred");
    class Server {
              JTextArea jt;
              public Server(JTextArea jt)
                   this.jt=jt;
              public void listenSocket() throws Exception
              ServerSocket ss=null;
              try{
              ss=new ServerSocket(8000);
              System.out.println("Server started");
             catch (IOException e) {
                         System.out.println("Exception");
                         System.exit(-1);
             while(true){
               ClientThread w;
               try{
            w = new ClientThread(ss.accept(),jt);
            Thread t = new Thread(w);
            t.start();
                catch (IOException e) {
            System.out.println("Accept failed: 8000");
           public static void main(String args[])throws Exception {
              /*Server t=new Server();
              t.listenSocket();*/
         class PrinterThread extends Thread
                public PrinterThread(JTextArea jt1,String msg)
                 jTextArea1 = jt1;
                 this.msg=msg;
                 System.out.println("PrinterThread constructor ");
                public void run()
                 try
                    Date today;
                    SimpleDateFormat formatter;
                    String output;
                     String pattern="dd.MM.yyyy '@' H:mm";
                    formatter = new SimpleDateFormat(pattern);
                    today = new Date();
                    output = formatter.format(today);
                        System.out.println(" "+output+"  "+msg+" \n");
                          jTextArea1.append(" "+output+"  "+msg+" \n");
                          jTextArea1.updateUI();
                             jTextArea1.revalidate();
    //                      JOptionPane.showMessageDialog(null,"hi");
                          //System.out.println("Get text "+jTextArea1.getText());
                 catch (Exception exception) {}
                private JComboBox combo;
                private JTextArea jTextArea1;
                String msg=null;
    //client.java
    import java.net.*;
    import java.io.*;
    import java.io.File;
    public class client {
           public static void main(String args[]) {
                   try {
                           Socket ss=new Socket(InetAddress.getLocalHost(),8000);
                           DataOutputStream dos=new DataOutputStream(ss.getOutputStream());
                           for(int i=1;i<100;i++){
                              if((i%2)==0)
                            dos.writeBytes("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,3233");
                              else
                            dos.writeBytes("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42");
                           Thread.sleep(5000);
                   catch(Exception e) {
                   e.printStackTrace();
                   System.out.println(" ");
    }

    You need to run your Server in a separate Thread.
    Right now its running in the GUI Event Thread.I created new thread for my server, now it's updating jtextarea.
    Thank you very much.

  • Clearing a JTextArea

    Ok, here's a problem I couldn't quite find by searching (though I found some sort of connected). In my program here, I have an editable JTextArea. I want to have a clear button on my form, but I just can't get the TextArea to clear. I know there's no setText, just appendText. It seems like it should be simple, I just don't get it, can someone help please? Thanks for your time
    --Jon Baumann                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Sorry about that last suggestion
    It's friday and not all with it,
    I never looked at the start properly
    I am using TextArea class and not JTextArea which does have the setText() method
    But i just looked up the class documentation for JTextArea and does it not inherit the setText() method
    from textComponent????

  • Problem clearing GR/IR when PO in currency different to Company currency

    Hi Experts
    I have an issue where I have a PO in say USD where group currency for company is Aus Dollar (AUD)
    At Month end, for whatever reason there is a GR/IR balance and we maintain it with MR11 but MR11 balances the difference in group currency (AUD) where all other postings for the PO are in USD.
    When we run F.13 or F13E the account never clears as it only clears matching transactions of same currency. We seem to never be able to clear the posting created by MR11 (without introducing a large tolerance in F.13 perhaps?)
    Any ideas on a way forward?
    thanks
    AC

    Hi AC,
    Eventhough the P.O is in foreign currency, when you select the Only balances in local currency option, system stores the values only in company code currency. So while clearing you'll not face any issue.
    If not maintain this indicator, then system stores the values in local currency and that foreign currency also, then while clearing you'll face the problem.
    Only balances in local currency setting should activate to GR/IR clearing account
    Rgds
    Murali. N

  • Selection problem in rendered JtextArea.

    I create a jtable by rendering one column using jTextarea. While selecting the row, color of selection not geting to the rendered Jtextarea. How can i solve this problem.
    please help me

    Do you include code in your getTableCellRendererComponent method to change
    the color depending on if the row is selected or not? You'll need something like
         if ( isSelected ) {
              setForeground( table.getSelectionForeground() );
              setBackground( table.getSelectionBackground() );
         } else {
              setForeground( table.getForeground() );
              setBackground( table.getBackground() );
         }: jay

  • Problem clearing a task

    Hello,
    Thanks to a few of the members here, I am able to control the opening and closing of two digital water nozzles with DAQ hardware timing.
     The way the application works is basically a 2-D array of boolean values is created based on the desired period and high time.  The nozzle will open when the boolean value is true while it closes when the boolean value is false.
    The only problem remain is that if the application stops when the last boolean value is "true", the water nozzle will remain open indefinitely.  I believe that I am not using "clear Task" correctly.  This is the most obvious when i set the high time = period so that the duty cycle is 100%. this way the array contain only "true" values.  No matter how i stop the application, the nozzles won't turn off.
    I have attached the application here and let me know if there are something wrong with the way I am ending the tasks.
    I tried to keep this brief so if there are something I'm missing please ask.
    Thank you very much
    Attachments:
    microsecond_nozzle2.vi ‏209 KB

    With outputs, they will always retain the last value sent to them.  Clearing the task does not reset them.
    What you will need to do is write a set of all Falses to the task before you clear the task and end the program.
    By the way, your use of the select function does nothing.  (If true select true, if false select false).  You can use the wire as is and eliminate the Select function and the true and false constants.
    Message Edited by Ravens Fan on 09-09-2008 02:12 PM
    Attachments:
    microsecond_nozzle2[1]_BD.png ‏4 KB

  • Problem clearing applet's screen for different images

    I have an applet that displays several jpg-images.
    Images are photos of different sizes that are portrait
    and landscape.
    Problem is that the rest of a portrait image remains at
    the screen when a landscape image is dispayed and
    in the same way the rest of a landscape image remains
    at the screen when a portrait image is displayed.
    I thought update and repaint methods should do the
    work but something is wrong.
    Code that should do it is:
    private void runWork() {
       curFrame = 0;
       try {
            while(noStopRequested) {
         waitWhilePaused();
         curFrame = (curFrame + 1) % image.length;
         repaint();
         Thread.sleep(5000);
       } catch (InterruptedException e) {
             Thread.currentThread().interrupt();
    public void paint(Graphics g) {
        update(g);
    public void update(Graphics g) {
       g.drawImage(image[curFrame], 0, 0, this);
    }What am I doing wrong?
    Thanks in advance

    Yeah, I knew flickering would probably happen. I've never done double-buffering exactly in an applet, but I can give you an idea how it's done.private void runWork() {
       Image offScreen = createImage(appletWidth, appletHeight);
       Graphics offGraphics = offScreen.getGraphics();
       try {
          while (noStopRequested) {
             waitWhilePaused();
             curFrame = (curFrame + 1) % image.length;
             offScreen.clearRect(0, 0, appletWidth, appletHeight);
             offScreen.drawImage(image[curFrame], 0, 0, this);
             repaint();
       catch (...) {}Then in paint():public void paint(Graphics g) {
       g.drawImage(offScreen, 0, 0, this);
    public void update(Graphics g) {
       paint(g);
    }Might not be perfect, but it should give you an idea. Basically you want to draw the screen OFF the screen before drawing it to the screen. That way you don't clear the screen and draw the image. You do it all in one paint().
    Michael Bishop

  • Problem clearing floats

    Here is an interesting problem. My page has a left sidebar, which is obviously floated left. In the main part of the page, I want to float an image so the descriptive text will be next to it rather than below it. I have multiple images to do this with. So, if I try and clear the left float, the images nest to the right of the previous image, crowding up underneath the text. This is not desirable. If I clear the left float, it puts the next image at the bottom of the left sidebar, also not desirable. Only the footer should go below the left sidebar. I have checked in a css book, it gives a couple ideas, but they don't work as their examples are not for nested floats like this.
    Any ideas? Here is the page: http://www.hainingfamily.com/media.php
    Thanks,
    Mike

    Include your anchor within the <div> too. Ive renamed the <div> class 'pictureLink'
    <div class="pictureLink">
    <img src="images/TheHainingFamilyPromoPic.jpg" alt="color picture" width="90" height="60" />
    <a href="images/thehainingfamilypromopic.jpg" target="_blank">Color Picture in jpg format (546KB)</a>
    </div><!-- end pictureLink -->
    <div class="pictureLink">
    <img src="images/TheHainingFamilyPromoPic.jpg" alt="color picture" width="90" height="60" />
    <a href="images/thehainingfamilypromopic.jpg" target="_blank">Color Picture in jpg format (546KB)</a>
    </div><!-- end pictureLink -->
    Then use this css to 'clear' and 'flloat' the image left.
    .pictureLink {
    width: 280px;
    overflow: hidden;
    margin: 0 0 10px 0;
    .pictureLink img {
    float: left;
    No need then for your <br class="clrlft" />. Overflow: hidden; on the .pictureLink <div> forfills that purpose and makes the code cleaner and easier to manage.

  • Problem clearing visited links

    I am having a problem with clearing visited links in Win 7 / Firefox 11.o
    I can clear visited links '''''except for one site''''':
    Silicon Investor:
    http://www.siliconinvestor.com/home.aspx
    I go to:
    * Tools
    * Clear recent history
    * Time Range to clear: Everything
    * Clear Browsing and Download History
    * Clear Cache
    * Clear Active Logins
    * Clear Offline Website Data
    Again, the only site that will '''not''' clear is Silicon Investor.
    Thanks for your help!
    PS: On '''Silicon Investor''' site, the '''''History''''' clears, but the '''''Visited Links''''' do '''NOT''' clear.

    Yes, I am reloading the page and nothing changes.
    Also, several times I have reloaded the page and then shut down my PC and restarted. Nothing seems to clear the visited links.
    I tend to think the problem may be at Silicon Investor - maybe some incompatibility with Firefox 11.0 ?
    Thanks
    PS: I have done some more experimenting and discovered the following:
    1. If I am '''logged in''' to the Silicon Investor site I can clear history, but I am unable to clear the visited links.
    2. If I am '''''NOT''''' logged into the Silicon Investor site I can clear history, '''''AND''''' clear the visited links with no problem at all.
    So, I am thinking that there IS some incompatibility that occurs ONLY when logged in.
    Strange!

  • Problem clearing Cell on a TiledLayer

    Hi,
    I've got a problem with a TiledLayer in that I when I set a cell to 0 to clear it nothing happens. It works fine when I set it to anything else so it's definitely not a problem with the layer not being drawn, but if I try and clear it the last specified tile is displayed.
    I've checked whether the change was stored by calling getCell() for the cell in question and the 0 has been stored.
    Is there anything that I'm missing or a specific reason why I might be having this problem?
    Thanks in advance
    Nick

    Just figured it out myself. Came from a lacking understanding how the whole frame buffer thing works. I've now figured out that it simply copies the buffered frame over the original one, so as an empty cell will be transparent on the buffered frame you can see the original frame in that place.

  • Problem with the JTextArea

    I'm using the swing packege 1.1 and having some problem when trying to limit the number of character per line in a JTextArea component.
    I want the JTextArea to change line when a certain number of character are typed in one of these lines.
    Any idea?
    thank you all.

    Do you mean you want to set the number of characters per line for example to 20 so all the lines in the JTextArea will hold only 20 characters? If so, this code shows a way to do it. If you use a fixed-width font, as in the example, all lines will hold the same number of characters. If you use a variable-width font, you could have lines with slightly more or slightly fewer characters, depending on what the user enters. The frame must not be resized.
          int chars_per_line=20;
          JFrame jf=new JFrame();
          JTextArea jta=new JTextArea(24,chars_per_line);
          jta.setFont(new Font("Courier",Font.PLAIN,14));
          jta.setLineWrap(true);
          jf.getContentPane().add(jta);
          jf.pack();
          jf.setResizable(false);
          jf.setVisible(true);

  • Select problem in the JTextArea

    Hi
    I have a problem on the select(), I am trying to select multiple lines of text in the JTextArea, but select(int start, int end) can only select single line, int end will be cut to the length of the line instead of going to the next line. Can anyone give me any advice?
    Thanks in advance

    DefaultHighlighter highlighter = (DefaultHighlighter)textArea.getHighlighter();
    highlighter.setDrawsLayeredHighlights(false);

  • How do I clear a JTextArea.

    well, as the title says.
    The only info I can find in my docs is selectALL but then what do I do with it.
    I've got a search result updating the JTextArea and I want to clear it after each search.
    cheers ;)

    now i really feel like an idiot.
    cheers.
    I won't tell you how long i've been trying to work that out.No need to feel ashamed; I know those situations: after hours and hours of
    hacking and trying, you simply have to give up because during those tedious
    hours you've developed nothing but a blind spot for the obvious solution ;-)
    kind regards,
    Jos

Maybe you are looking for