Problem sizing a JTextArea

I'm trying to write a class with a button which, when clicked, will alternate between two panels.
My problem is the entire "details" message will not display.
I've tried various combinations of layout managers with calls to setSize() and setRows(), or using a JTextPane instead.
My brain feels like a bowl of spaghetti because I'm not getting anywhere.
What am I missing?
Thanx to one and all.import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import  javax.swing.border.*;
public class ToggleButton extends JFrame implements ActionListener
   private JButton button;
   private JPanel panel , detailPanel;
   private Container contentPane = getContentPane();
   public ToggleButton()
      setLayout(new GridLayout(2,1));
      setBounds(400 , 250 , 200 , 100);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      button = new JButton("Show Details");
      button.addActionListener(this);
      panel = new JPanel();
      panel.add(button);
      JTextArea details = new JTextArea();
      TitledBorder  border = BorderFactory.createTitledBorder("Details");
      details.setBorder(border);
      details.setLineWrap(true);
      String text = "Now is the time for all good women to come to the aid of their men.";
      details.setText(text);
      detailPanel = new JPanel();
      detailPanel.add(details);
      contentPane.add(panel);
      setVisible(true);
   public void actionPerformed(ActionEvent ae)
      if (ae.getActionCommand().equals("Show Details"))
         button.setText("Hide Details");
         setBounds(400 , 250 , 200 , 200);
         contentPane.add(detailPanel);
      else
         button.setText("Show Details");
         contentPane.remove(detailPanel);
         setBounds(400 , 250 , 200 , 100);
   public static void main(String[] args)
      new ToggleButton();
}

   public void actionPerformed(ActionEvent ae)
      if (ae.getActionCommand().equals("Show Details"))
         button.setText("Hide Details");
         setBounds(400 , 250 , 200 , 200);
         contentPane.add(detailPanel);
      else
         button.setText("Show Details");
         contentPane.remove(detailPanel);
         setBounds(400 , 250 , 200 , 100);
      validate();
   }The Grid layout will cause problems, but I am sure you can figure that out.
FYI: It might be better practice to toggle the details panel's visibility rather than adding and removing it. Just a thought.

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.

  • Imovie: i am having problems sizing my image

    imovie: i am having problems sizing my image when i convert the cells into a 'project'.
    I can see all the image in full, - until i drag it into project area, then in the view window the image is too large and is cut in half.
    i have adjusted the PAL size . large full view etc..
    I tired exporting and even when exported to quicktime, the image is cut in half.
    does anybody have any idea what the problem is?
    thanks

    Hello lucglobal68,
    The following article contains information regarding the options you have with cropping (or not cropping, if you'd like the entire image to show) images in iMovie.
    iMovie '11: Crop video clips or still images
    http://support.apple.com/kb/PH2232
    Cheers,
    Allen

  • 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.

  • 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 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);

  • Problems with disappearing JTextArea when activating JMenu

    Im having trouble with using JTextArea in conjunction with JMenu and JInternalFrame. I have a program that uses JInternalFrames for navigation, when the navigation been used I set the JInternalFrame to setVisible(false) and display a JMenuBar with several components and a JTextArea. The JTextArea gets displayed as it should and so is the JMenuBar but when a JMenuItem has been activated the JTextArea becomes invisible or partly invisible. Anyone have any suggestions?
    //Function that removes the JInternalFrame and adds the JMenuBar and JTextArea to the program
    public void ordBehandlare()
                   ramnav.setVisible(false); //ramnav == JInternalFrame
                   Container cont = getContentPane();
                   cont.add(ordbehandlarArea); //ordbehandlarArea == JTextArea
                   setJMenuBar(ordBehandBar); //ordBehandBar == JMenuBar
    Grateful for any answers...

    From the 5 lines of code you posted I have no idea whats wrong, but I'm sure you can create a 20 line program that we can compile and execute that demonstrates your problem. Chances are while your creating this simple program you will find your error.

  • 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("");

  • Problem with JMENU / JTEXTAREA

    Hello All,
    I have the following problem:
    I want to create a little text editor. I just have a window containing
    a menu bar and a text area. The basic functions work fine. I can open a
    file and read it into the text area.
    The problem I have is, that my menu is affected by the file chooser window. When I close the file chooser parts of the selected file or the
    file chooser will be painted in my menu. In the worst case it deletes menu items.
    Does anybody knows help?
    Thank you in advance.
    Ralf

    It sounds like your program is busy doing something else after the filechooser closes, which is causing your GUI not to repaint. I assume you are performing some io on the file after the user click the OK button, that is probably whats causing it to not redisplay your menus. Or you could be getting an exception opening your file which usually causes the GUI to hang. If you not getting an exception and your sure your io code isn't infinite looping, then your best option to fix this is to run the io code in a separate thread.

  • Problems sizing multiple JPanels.

    I'm writing a survey program that needs to be formatted to a certain size. I'm using calls to panel.setsize( ) to set the size to 800 x 600.
    I have nine JPanels as globals, all of which are created and "packed" initially. These JPanels are supposed to display in a global JFrame, one at a time. After each "next button" click I call frame.remove(panel) to remove the current panel and frame.add(panel) to add the next. Then I call pack again.
    Everything works fine until looping from the final panel to the first. Upon doing so all of the elements in the JPanel disappear, (although hovering over the invisible elements makes them reappear.)
    Is there anything I'm doing wrong?

    Well, calling repaint after pack seemed to solve the problem.
    Does anyone care to provide insight as to why?
    Thanks.

  • Problems Sizing Windows

    Hello all,
    I'm trying to develop a simple web browser but I'm having trouble getting the sizes of the components set up right. Right now the webpage is shown via a JEditorPane. The JEditorPane is passed as the constructor to a JScrollPane object and the JScrollPane is added to a JPanel which is added to the content pane of the JFrame. It looks something like this:
    JEditorPane jp = new JEditorPane();
    jp.showPage(url);
    JScrollPane sp = new JScrollPane(jp);
    JPanel p = new JPanel();
    p.add(sp);
    return p;
    //Then in my JFrame class
    getContentPane().add(p, BorderLayout.CENTER)";
    {code}
    This isn't exactly what the code looks like but you get a general idea.  The problem is that when the webpage loads it doesn't always fit correctly in the JEditorPane.  Some of gets cut off and I have to resize the window because the scrolling doesn't seem to work perfectly.  Also resizing the window screws up how the webpage gets displayed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This isn't exactly what the code looks like but you get a general idea.Well your code is wrong. Hope you get the general idea of the answer.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Problems sizing photos for wallpaper

    Since the IOS software updates I have been unable to resize photos for wallpaper &amp; lock screen, they just don't remain the size or position I set.

    You can try this:
    http://support.apple.com/kb/HT5595
    If that doesn't fix things, you may want to try my workaround:
    https://discussions.apple.com/thread/5335229?tstart=90

  • Problem sizing the Safari screen

    I zoomed in on a Safari screen with 'ctrl' + the mouse scroll button and after zooming out again I couldn't get my Safari screen to full screen size. I try 'maximizing' the screen but the only thing that happens is the screen remains the same size but moves positions on the iMac monitor. Any suggestions as to what to do?

    Perhaps an explanation of how the MM works is in order and will help. I have to admit that the MM takes some getting used to and a bit of hand coordination. I got the hang of it quickly and have no issues with it.
    The exterior of the MM is touch sensitive. It can "feel' your fingers on the exterior and interprets what it senses to determine what it thinks you want to do. I rest my hand on the MM with thumb and ring finger in the area of the side buttons and index finger to the left of the scrollball and the middle finger to the right of the scrollball. The MM is configured in System Preferences/Keyboard & Mouse/Mouse with the Primary click on the left (with my index finger) and the Secondary click on the right (with my middle finger.)
    If you click with the index finger to the left of the scrollball, you get a Primary click, with or without the middle finger touching the MM. To get a Secondary click, click with the middle finger to the right of the scrollball, but the index finger must be lifted from the MM.
    I use a rocking of my two fingers. When I Primary click my middle finger goes up. When I Secondary click my index finger goes up. (I never could master the side button squeeze, so I turned them off in System Prefs.)

  • Problem in displaying data in JTextArea

    Please help solve my problem regarding the JTextArea. I have two classes, Destination and AddRegistration class which both extends the JPanel. In the Destination class, there are three radiobuttons, when I click on this, I want the item to be displayed in the textarea of the AddRegistration class. The problem is that the text area does not display the item I selected in the radiobutton. What should I do?
    the code in the Destination class is this:
    public void actionPerformed(ActionEvent e){
    labelChoice.setText("From: "+e.getActionCommand());
    this.setText(e.getActionCommand());
    AddReservation addRes = new AddReservation();
    public void setText(String text){
    destination = text;
    public static String getText() {
    return destination;
    and the code in the AddRegistration class :
    JTextArea outputarea = new JTextArea("From : ");
    add(new Destination()); //From Destination
    Destination instance1 = new Destination();
    add(outputarea);
    String t = "";
    t = instance1.getText();
    outputarea.append(t);

    maybe u should revalidae and repit the panel after setting the text?

Maybe you are looking for

  • Plans larger than 500GB

    Are there any plans of having quotas increased from the maximum 500GB that is available now. I'm finding my limit is being used quite frequently and quickly as the months go on. I utilise iTunes for a lot of my TV and am finding that for the qaulity

  • What's the best way to locate PrPro5.5 Bottlenecks on a Mac?

    First off, due to employer demand, I had to switch over my 8 year long stretch of using a PC for Adobe products over to a new Mac Pro. I was adamantly against this but seeing as I don't run the place, I was overruled. About a month ago the beast arri

  • Error "REP-0788: Warning" on registering custom report to e-Business Suite

    Hi I done the register of custom report to Oracle e-Business Suite 11i got the below error +----------------------------- | Starting concurrent program execution... +----------------------------- Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environmen

  • How to scan on Mac OS10.10.2 by HP Color LaserJet Pro MFP M177fw?

    hello,  i try few different way but still don't know how to scan things. anyone know how to scan on Mac OS10.10.2 by HP Color LaserJet Pro MFP M177fw? it have no problem on printing by wifi. thanks, Les

  • Limit user Access to Return Data in Report

    Have reporst that I need to limit what is returned. The person running the report should only see the data that they own. Is this possible. Can I set an attribute based on the person who has signed on to Discoverer and use that in the select to limit