The size of the main frame

Hi
im using swing, and i want my main frame to be maximized
i use this code :
cipherplus win = new cipherplus();
   Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension temp = toolkit.getScreenSize();
        int h = temp.height;
       int w = temp.width;
        win.setSize(w,h-30);
        win.show();the prolem is, and i dont have any clue why, when i use the resolution size 800 * 600 i dont see everything that is on the frame...
so can anybody please tell me what is the problem?
tanx

Two things:
1) There was a mistake in what I gave you. What you have will work if there is only 1 bar, but it doesn't work if there is a bar on top and one on the bottom.
Replace:
screenSize.width -= insets.left - insets.right;
screenSize.height -= insets.bottom - insets.top;With this:
screenSize.width -= (insets.left + insets.right);
screenSize.height -= (insets.bottom + insets.top);2) Don't forget to set the location to be at the insets. for you it would be adding this line:
win.setLocation(insets.left, insets.top);Put that between setSize() and show().

Similar Messages

  • HELP!!! JTextArea keeps resizing to the size of the frame i have it on!!!1

    I have a Frame that has a panel with a JTextArea in it, but when the text area is displayed (regardless of what size i declare it ) it resizes itself to the size of the frame .. Anbody that can telkl me why it does this, thanks in advance ; )

    okay, i'm back from lunch. maybe this will give you some ideas. i added borders so you could see the outline of the scroll pane as opposed to the top panel which i'm thinking should be called left panel since you have it to the west. it's not meant to represent the best design, only to demonstrate some thoughts.
    import javax.swing.*;
    import java.awt.BorderLayout;
    import java.awt.event.*;
    public class MyFrame extends javax.swing.JFrame {
       private JPanel panel;
       private JScrollPane scroll;
       private JTextArea area;
       /** Creates a new instance of MyFrame */
       public MyFrame() {
          init();
       private void init(){
          setTitle("My Frame");
          panel = new JPanel();
          panel.setBorder(BorderFactory.createTitledBorder("my panel"));
          area = new JTextArea();
          area.setLineWrap(true);
          area.setWrapStyleWord(true);
          area.setRows(15);
          scroll = new JScrollPane(area);
          scroll.setBorder(BorderFactory.createTitledBorder("my scroll"));
          panel.add(scroll);
          getContentPane().add(panel,BorderLayout.WEST);
          setSize(400, 400);
          setLocationRelativeTo(null);
          addWindowListener(new WindowAdapter(){
             public void windowClosing(WindowEvent we) {
                System.exit(0);
          String tmp = "here is some text to test an area";
          for(int i=0;i<50;i++)
             area.append(tmp);
       public static void main(String[] args) {
          new MyFrame().setVisible(true);
    }

  • Getting the size of an internal frame?

    Hi allm
    I want to be able to get the size of an internal frame. I have set the size of the main JFrame to that of Windows by calling Toolkit.getScreenSize(); But i can't seem to find an equivalent for internal frames.
    Basically I have two components in the internal frame that I want to have equal width. I was going to find out the size of the internal frame and then half it and applay a horizontal strut to each component.
    If there is a better way of doing it i'm open to suggestions but any help at all is much appreciated
    Thanks
    Dylan
    BorderLayout border = new BorderLayout();       
             content.setLayout(border);
             Box left = Box.createVerticalBox();
             left.add(Box.createHorizontalStrut(400));
             JPanel Create = new JPanel();
                 Create.setBorder(new TitledBorder (new EtchedBorder(), "Create Database"));
                 left.add(Create);
                 Box right = Box.createVerticalBox();
                 right.add(Box.createHorizontalStrut(400));
                 JPanel Help = new JPanel();
                 Help.setBorder(new TitledBorder (new EtchedBorder(), "Help"));
                 right.add(Help);
                 content.add(left, BorderLayout.CENTER);
                 content.add(right, BorderLayout.CENTER);

    The situation is that I have a class that has about 80
    instance fields of basic data types. But it was
    getting overly complicated. As a number of these
    fields related to year and day data I tried to
    re-write with GregorianCalendar instead.
    There are in the region of 45,000 instance of my clas
    being held in an array, however when I tried to use my
    modified class (with the Calendar fields replacing the
    basic data types) I kept running into OutOfMemoryError
    after about 25,000 instances were created. So I
    figured that the GregorianCalendar class must be
    eating up my memory. Was intrigued, but couldn't find
    out how to calculate the size of my new class.
    Hmmm, serialize it you say? Ok, I'll try that.ok don't do that ;)
    ummm i was giving advice assuming (incorrectly i turns out) that you were trying to see how much space the serialized object would take up when written to disk or over a network etc.
    this does not appear to be your problem.
    so here are my new more informed suggestions.
    1) if you were going to write out the "data" parts of your object so
    it could be re-created what would they be. i'm thinking you could
    just boil it all down maybe to a long as in Date.getTime(); then
    you could have a long[] array with 45,000 slots. this should take up far less memory than having myObject[] with 45,000 slots. then you
    could have one actual object that you insert the data into to play
    around with. this may not be the idealists solution but if you have a
    lot of objects you may not want to carry around all the excess
    stuff.
    2) as an aside you say you tried to re-write the GregorianCalendar...
    have your tried extending it or extending Calendar. the idea of
    extending other non-final classes is you can provide your own
    implementation of some things or add totally new methods without having
    to re-write an existing class.
    just some ideas...

  • Global change to the size of a text frame in InDesign 5.5?

    Is there a way to make a global change to the size of a text frame in InDesign 5.5? I just laid out a book and the size needs to go up half an inch.

    If you have worked properly and have done following:
    Set up Masters with margins and columns,
    Aligned all text frames with the margins,
    Turned on Layout Adjustment,
    You will only change the margins on the Master and it will change every page.
    If not …
    you have to do it manually.

  • How to set the size of the frame in the decoration controls

    Hi,
    I am drawing some frames or boxes using the patterns in the "Decorations" control in labview.
    Is there other way to set the size of the frames or boxes rather than to drag them? also how can I change the color of the borders?
    Thanks,
    Joyce
    Solved!
    Go to Solution.

    Select the item.  Go to the Resize Objects button on the toolbar.  Pick the last one which shows a resize within a dialog bubble.  Now a dialog pops up which lets you define the height and width.
    To color something, Shift right click to bring up the toolbox.  Pick the paint brush.  Click on the thing you want to change such as the border.  It might now be the wrong color, so right click which brings up the color picker.  Now select the color you actually want.  If you want something to be transparent, pick the T at the upper right corner of the color dialog box.

  • How to set the size of a JTabbedane to the size of the frame

    I have a tabbed pane in a frame, I would like to know how to set the size of the tabbed pane, so that it occupies the whole of the frame which has been set to screen size.
    Thanks

    Is it not possible to use it with a GridBagLayout?Your question was "How do I get a tabbed pane to take all the space of the frame"?
    You where given the answer. Did you try it? Did it work? Then why are you questioning the suggestion?
    Its one line of code if you use a BorderLayout which by the way was specifically designed for this purpose.
    Yes you can do it with a GridBagLayout with about 5 lines of code.
    So the question is why would you want to write 5 lines of code when you can use one?
    If your question was "How do I waste my time forcing the GridBagLayout to size a component to take up all the space of the frame", then you would have received a different answer. (Although most people would have told you to use a BorderLayout anyway, since its easier).

  • Getting the Size of the Process Window Frame.

    Hi All,
    I have a small class which when executed wakes me up an notepad.exe.
    Process P=Runtime.getRuntime().exec("notepad.exe");After opening the notepad i want the size of the displayed frame.Can any one help me out in getting this??.
    regards,
    Viswanadh.

    That is impossible from pure java, and it would require a lot of native code to do so. You'd have to obtain the correct process id and retrieve the native frame from windows... honestly, I'd reconsider that requirement...

  • How to define the size of the frame

    I have create a frame in my jbuilder env, how can I define the size of the frame and change
    some attributes of the frame.
    Which method shall I invoke?

    To define the size of the frame use setSize method.
    To avoid minimise and maximise button use setResizable method with parameter as false.

  • How to limit the size of the main window width according to the line items?

    Hi,
           In my requirement,I created one page with main window....Suppose say main window can accomodate 40 line items.
          I am getting 5 pages data.And in my last page ( ie 5'th page ) I will have only 20 line items.But for the remaing 20 line items,
         it showing empty area .I created widow with borders and one vertical line between the columns.....I created two columns.
         Please I dont want any horizontal lines between the line items but I created one vertical line between the columns..
           Any right help would be appreciated.
    Thanks,
    Chinnu
    Moderator message - Welcome to SCN.
    But duplicate posting is not allowed. If you have information you want to add to your post, you can edit it or post a follow up - Thread locked
    Edited by: Rob Burbank on Feb 19, 2010 12:17 PM

    One way is to periodically (say every week) create a new file to store the actions and then, when the space taken up by all the files is too large, delete the oldest one.
    You can also have your application periodically (say the first time you write to the file on any calendar day) check the size of the file and, when it gets too big, copy all of the actions in the file after a given time (presumably there is an associated timestamp with each action) to a new file. Then delete the old file.

  • Adjusting the size of the "pop up" sub vi in the main vi

    I am trying to reduce the size of the "pop up" sub vi in the main vi. If I push everything upwards, the info downwards is lost. Similarly the side info is lost. How to adjust the size and yet keep all the info. I am using LV6.0. I have attached the file concerned.
    Attachments:
    RTF Test Setup.doc ‏84 KB

    There is obviously a misunderstanding here.
    You have full control over the front panel and you can make all the controls as small or large as you want. In addition, you can also place them wherever you want. It is up to you as the designer to place them how you want. If you want then all to be a few pixels by a few pixels, LabVIEW will allow that. Obviously, a string control that is 3 pixels wide and 2 high is unusable, but you can do it. In addition if you wanted all the controls to over lap that is fine, but again it will most likely be unusable for your user.
    If your question is the mechanics of moving and re-sizing controls, LabVIEW works the same as most products. You need the arrow tool, which you can get from the tools pallette (Windows>> Show Tools Pallette). With that tool you simply click on the control and move it where you want it. To resize it you hover over the borders of the control until you see the little resize squares and then re-size away. This is the same as how you would re-size an object in Word etc.
    If you are simply asking for some examples based on the front panel you attached, we on the forums can move them around and give you examples but we don't know what it is you as the designer or your "customers" want. Therefore anything we do is a shear guess and unlikely to be what you really want. By far the best option is for us to help answer for you the how so that you can create the front panel that you want.
    So can you re-phrase the question or help us understand what it is you want?

  • How to fix the size of the frame or window?

    Hi,
    Do you know how to fix the size of the frame or window so that the user cannot minimize or maximize it?
    Thanks.

    Frame's setResizable(false);.

  • How to change the size of the caret in a JTextPane

    I have text of different font sizes and the default caret height is the height of the text with the maximum font size. How do I change the caret height so that it matches the height of the text with the specified font size ?

    This has been a real pain in the butt to figure out, but I think I finally got it. If you create your own caret (subclass of DefaultCaret) then you override its paint() and damage() methods. I was having all kinds of problems with this though. I was getting pieces of carets left behind when I moved with the arrow keys, etc... from the helps I found. The arrow keys were my big problem.
    I think I finally figured out that the damage() simply does need to specify an area a little bigger than the old caret so it can blank it out. Then I think others had a logic problem, and Sun does not make this problem clear. What happens it that I think repaint() calls paint() who then uses the bigger x, y, height and width parameters that got set in damage(), which was causing my problems because the damage size was bigger than the size I wanted to create my caret with. What I do is figure out my area from the font I am using (another trick) and make them (the charWd and charHt) variables class variables. I calculate them in damage, use a bigger area to blank out my old caret in damage, and then used the correct caret size I calculated in damage() in paint(), instead of the rectangle values that seem to get passed from damage() to paint(). That was the problem in other examples.
    Here is my code:
    run with java caretPain
    run with java caretPain -1 to see my fixed version
    run with java caretPain -2 to see some problems
    // written by: Stan Towianski
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Hashtable;
    import java.util.ArrayList;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.text.*;
    import javax.swing.plaf.*;
    import java.net.URL;
    import java.io.*;
    import java.beans.*;
    public class caretPain extends JFrame {
    static caretPain CRTP2;
    JPanel contentPane;
    JTextPane textPane;
    JTextPane textPane2;
    JScrollPane scrollPane;
    JSplitPane splitPane;
    String newline = "\n";
    static final int MAX_CHARACTERS = 300100;
    static int FrameWidth = 500;
    static int FrameHeight = 300;
    String caretType = "blockOutline";
    static int useSpecialCaret = 0;
    DefaultCaret useCaret = new MyCaret();
    public caretPain() {
    textPane = new JTextPane( new DefaultStyledDocument() );
    textPane2 = new JTextPane( new DefaultStyledDocument() );
    if ( useSpecialCaret == 1 )
    System.out.println( "using special caret 1" );
    textPane.setCaret( useCaret );
    else if ( useSpecialCaret == 2 )
    System.out.println( "using special caret 2" );
    textPane.setCaret( new WsCaret() );
    textPane.setCaretPosition(0);
    textPane.setMargin(new Insets(5,5,5,5));
    scrollPane = new JScrollPane(textPane);
    textPane.setPreferredSize(new Dimension(FrameWidth, FrameHeight));
    JScrollPane scrollPane = new JScrollPane(textPane);
    //Create a split pane for the change log and the text area.
    splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
    textPane, textPane2 );
    splitPane.setOneTouchExpandable(true);
    //Add the components to the frame.
    contentPane = new JPanel(new BorderLayout());
    contentPane.add(splitPane, BorderLayout.CENTER);
    setContentPane(contentPane);
    class MyCaret extends DefaultCaret
    int charWd = 30;
    int charHt = 30;
    // draw the caret
    public void paint(Graphics g)
    System.err.println( "entered MyCaret.paint()" );
    if ( ! isVisible() )
    System.err.println( "exiting because not visible" );
    return;
    try {
    JTextComponent c = getComponent();
    int dot = getDot();
    Rectangle r = c.modelToView(dot);
    System.err.println("caret: text position: " + dot +
    ", view location = [" +
    r.x + ", " + r.y + "]" +
    newline);
    g.setColor(c.getCaretColor());
    //g.drawLine(r.x, r.y + r.height - 1, r.x + 14, r.y + r.height - 1);
    System.err.println( "caretType =" + caretType ); //+ " component =" + c.toString() );
    if ( caretType.equals( "blockOutline" ) )
    g.drawRect( r.x, r.y, charWd, charHt );
    else if ( caretType.equals( "block" ) )
    g.fillRect( r.x, r.y, charWd, charHt );
    else if ( caretType.equals( "bar" ) )
    g.drawLine( r.x, r.y, r.x, r.y + charHt );
    catch (BadLocationException e) {
    System.err.println( "bad caret loc" + e);
    // specify the size of the caret for redrawing
    // and do repaint() -- this is called when the
    // caret moves
    //protected synchronized void damage(Rectangle r)
    public synchronized void damage(Rectangle r)
    System.err.println( "entered MyCaret.damage()" );
    System.err.println("caret.damage(): text position: " + getDot() +
    ", view location = [" +
    r.x + ", " + r.y + "]" +
    newline);
    //FontMetrics fm = g.getFontMetrics();
    //System.out.println( "textPane getfont =" + textPane.getFont() );
    //System.out.println( "\n\n read in attribs font size =" + textPane.getInputAttributes().getAttribute(StyleConstants.FontSize) + "\n\n" );
    //int ii = Integer.parseInt( (String) textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) );
    int ii = Integer.parseInt( String.valueOf( textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) ) );
    //System.out.println( "textPane input attrib font size =" + ii );
    Font f = new Font( "ff", Font.PLAIN, ii );
    //System.out.println( "textPane input attrib font =" + f );
    FontMetrics fm = getFontMetrics( f );
    //FontMetrics fm = g.getFontMetrics();
    //FontMetrics fm = getFontMetrics( textPane.getInputAttributes().getAttribute( StyleConstants.FontSize ) );
    //MutableAttributeSet inputAttributes = getInputAttributes();
    //String fs = textPane.getAttribute( "FontSize" );
    //System.out.println( "\n\n read font size =" + textPane.getCharacterAttributes().getAttribute(StyleConstants.FontSize) + "\n\n" );
    charWd = fm.charWidth( 'k' );
    charHt= fm.getHeight();
    //System.out.println( "font width =" + charWd + " font height =" + charHt + " font =" + fm.toString());
    if ( r == null )
    System.err.println( "caret.damage() return on rectangle == null" );
    return;
    x = r.x - 2;
    y = r.y - 2; // + r.height - 2;
    width = charWd + 4; //textPane.getColumnWidth();
    height = charHt + 4; //textPane.getRowHeight();
    System.err.println("caret.damage(): set caret width, height, x, y =" + width + "," + height + "," + x + "," + y );
    repaint();
    //repaint();
    public class WsCaret extends DefaultCaret {
    transient private int[] flagXPoints = new int[3];
    transient private int[] flagYPoints = new int[3];
    public WsCaret() {
    this.setBlinkRate(500);
    public void paint(Graphics g) {
    if(isVisible()) {
    JTextComponent component = this.getComponent();
    TextUI mapper = component.getUI();
    Rectangle r = null;
    try {
    r = mapper.modelToView(component, this.getDot());
    catch(BadLocationException exc) {}
    //System.out.println( "rect r =" + r.toString() );
    //g.drawLine(r.x, r.y, r.x, r.y + r.height - 1);
    //g.drawLine(r.x+1, r.y, r.x+1, r.y + r.height - 1);
    g.drawRect( r.x, r.y, 10, r.height );
    Document doc = component.getDocument();
    if (doc instanceof AbstractDocument) {
    Element bidi = ((AbstractDocument)doc).getBidiRootElement();
    if ((bidi != null) && (bidi.getElementCount() > 1)) {
    // there are multiple directions present.
    flagXPoints[0] = r.x;
    flagYPoints[0] = r.y;
    flagXPoints[1] = r.x;
    flagYPoints[1] = r.y + 4;
    flagYPoints[2] = r.y;
    flagXPoints[2] = (true) ? r.x + 5 : r.x - 4;
    System.out.println( "going g.fillPolygon" );
    g.fillPolygon(flagXPoints, flagYPoints, 3);
    protected synchronized void damage(Rectangle r) {
    if (r != null) {
    this.x = r.x - 4;
    this.y = r.y;
    //there must be a better way to doing this, but for now you
    //just increase the width so that it will cover the new caret's size
    this.width = 20; // the original width is 10
    this.height = r.height;
    //this.height = r.height + 20;
    //this.height = 10;
    repaint();
    //The standard main method.
    public static void main(String[] args) {
    if ( args.length > 0 )
    System.out.println( "found arg so will use special caret." );
    if ( args[0].equals( "-1" ) )
    useSpecialCaret = 1;
    else if ( args[0].equals( "-2" ) )
    useSpecialCaret = 2;
    else
    System.out.println( "found no arg so will standard caret." );
    System.out.println( "give arg: -1 to get Stan\'s working caret" );
    System.out.println( "give arg: -2 to get another example\'s caret" );
    try
    CRTP2 = new caretPain();
         catch (Exception ex)
    System.out.println("Error creating CRTP2: " + ex);
    ex.printStackTrace();
    System.exit(0);
    CRTP2.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void windowActivated(WindowEvent e) {
    CRTP2.textPane.requestFocus();
    CRTP2.setTitle( "This is my title you" );
    CRTP2.pack();
    CRTP2.setVisible(true);

  • Make CardLayout/JTabbedPane the size of the current card/pane?

    Hi all,
    I have a set of panels that a user flips through, which I can implement either as a set of JPanels in a CardLayout or as a JTabbedPane with the tabs hidden -- it's no difference to me.
    If all the panels have been instantiated, the current panel is always the size of the largest panel in the set. So if the current panel is significantly smaller than the largest panel, there's a bunch of unnecessary white space.
    Is there any way to set things up so that the the currently visible panel is always that size that it would normally want to be (i.e. if it weren'tpart of a CardLayout/JTabbedPane)?
    Thanks!
    Sam
    Below is a self-contained example using a JTabbedPane, but the same applies to a JPanel with CardLayout.
    import java.awt.*;
    import javax.swing.*;
    public class SwingTester extends JFrame{
         public SwingTester(){
              JTabbedPane tabbedPane = new JTabbedPane();
              JComponent smallComponent = new JLabel("Test");
              tabbedPane.addTab("Small tab", smallComponent);
              JComponent largeComponent = new JLabel("Test ... Test ... Test");
              largeComponent.setBorder(BorderFactory.createLineBorder(Color.RED, 20));
              tabbedPane.addTab("Large tab", largeComponent);
              getContentPane().add(tabbedPane);
         public static void main(String[] args){
              SwingTester st = new SwingTester();
              st.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              st.pack();
              st.setVisible(true);
    }

    I think that you'll need to do more than revalidate and / or repaint. You'll need to repack the JFrame:
    import java.awt.BorderLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    class BigSmallPanels extends JPanel
        private static final String SMALL_PANEL = "Small Panel";
        private static final String LARGE_PANEL = "Large Panel";
        private JPanel smallPanel;
        private JPanel largePanel;
        BigSmallPanels(JFrame frame)
            setLayout(new BorderLayout(5, 5));
            setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
            smallPanel = createSmallPanel();
            largePanel = createLargePanel();
            add(largePanel, BorderLayout.CENTER);
            JPanel buttonPanel = new JPanel();
            JButton swapButton = new JButton(SMALL_PANEL);
            buttonPanel.add(swapButton);
            add(buttonPanel, BorderLayout.PAGE_END);
            swapButton.addActionListener(new SwapButtonListener(this, frame));
        private class SwapButtonListener implements ActionListener
            private JPanel panel = null;
            private JFrame frame = null;
            SwapButtonListener(JPanel panel, JFrame frame)
                this.panel = panel;
                this.frame = frame;
            public void actionPerformed(ActionEvent e)
                String command = e.getActionCommand();
                if (command.equals(SMALL_PANEL))
                    ((JButton)e.getSource()).setText(LARGE_PANEL);
                    ((JButton)e.getSource()).setActionCommand(LARGE_PANEL);
                    panel.remove(largePanel);
                    panel.add(smallPanel, BorderLayout.CENTER);
                    frame.pack();
                    //panel.revalidate();
                    //panel.repaint();
                else if (command.equals(LARGE_PANEL))
                    ((JButton)e.getSource()).setText(SMALL_PANEL);
                    ((JButton)e.getSource()).setActionCommand(SMALL_PANEL);
                    panel.remove(smallPanel);
                    panel.add(largePanel, BorderLayout.CENTER);
                    frame.pack();
                    //panel.revalidate();
                    //panel.repaint();
        private JPanel createSmallPanel()
            JPanel p = new JPanel();
            p.add(new JLabel("Small"));
            return p;
        private JPanel createLargePanel()
            JPanel p = new JPanel(new GridLayout(4, 4, 5, 5));
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 4; j++)
                    JLabel largeLabel = new JLabel("Large");
                    largeLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
                    p.add(largeLabel);
            return p;
        private static void createAndShowGUI()
            JFrame frame = new JFrame("BigSmallPanels Application");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().add(new BigSmallPanels(frame));
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }

  • IPhone 5 (16GB) iOS 7.0.4 Mail App size is 1GB and continuously increasing. How to reduce the size of the Mail App?

    Hi,
    I am using an iPhone 5 (16GB) iOS 7.0.4.
    Currently the size of the mail app is 1GB and is continously increasing, even though the advanced settings in the mail account have been set as following:
    MOVE DISCARDED MESSAGES INTO:
    Deleted Mailbox
    DELETED MESSAGES:
    Remove: After one day
    INCOMING SETTINGS:
    Delete from Server: When removed from Inbox
    The problem that I am facing is that only a few emails reside on my iPhone as I keep deleting emails, which are also deleted from the server automatically because of the settings as above, which is perfectly fine. The emails are deleted from the Mail app and only a very few of them are visible which I have not deleted as yet, and all is fine till here. The problem is that the size of the Mail app is more than 1GB and is continously increasing, when i check the size of the Mail app in the Settings > General > Usage section.
    When I search for an email that has previously been deleted from the search feature by swiping down in the main page, it still comes up in the search, and upon clicking the searched email, it takes me into the Mail app, however, the mail is not there. I have tried searching for emails which were deleted weeks ago, and they still come up in the search feature, however, they DO NOT open in the Mail app when i click them within the search feature in the main page.
    Up until a couple of months ago, the size of the Mail app was about 5.2GB and at this point I had no space on my 16GB iPhone 5, therefore I resetted my phone two months ago, and after a complete reset of the iPhone 5, the size of the Mail app went back to 0.3KB (like it was brand new out-of the box); however, within a matter of two months the size of the Mail app has now exceeded 1GB and is continously increasing, as I receive alot of emails which is why I delete them on daily basis and even delete them from the Trash folder (mailbox).
    I have read alot of blogs and even checked with other friends using similar settings on the same model, however, I just cant seem to figure this out. I would really appreciate if someone can help me with this issue as I dont want to have to reset it again after another 2-3 months.
    There are practically only 14-15 emails on my Mail app with not alot of KBs for these emails, and the trash folder is also empty, but the size of the Mail app is still not reducing. Please help!!
    Regards,
    Shoaib Malik

    Have you tried restarting or resetting your iPhone?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after It shuts down, press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).
    Also consider deleting and reinstalling the Mail Account in question.

  • Can I slim down the size of the Aperture Library by moving the Preview files elsewhere?

    Hi all,
    I have an Aperture library of almost 20,000 photos, dating back to around 2007. Almost all the master images are stored on an external drive (backed up of course), with only my recent and 'in progress' masters being stored in the library itself. Previously I have had my library split up into one library for each year, with the older years libraries being stored on the external drive where the masters are, in order to keep the size of my 'current' library down. So my current library, stored on my internal SSD, contained only photos from this year and last year, and only a few of the masters for these images. Confusing? Sorry!
    Now, I recently decided to consolidate the libraries into one huge library, because it was annoying to have to switch between libraries to find older photos when I wanted them. I did this, leaving all but the recent masters on the external drives (referenced). I thought that the size of the main library would remain reasonably sized, since there were no extra masters being moved into it. However, the library has grown massively - up to over 70GB, which is huge when you consider it's on a 128GB SSD which is also my startup drive.
    I'm pretty certain the reason for the huge size increase is that the Previews for all the older images are stored in the Library file, rather than anywhere else. This makes sense - they are previews, they're supposed to be able to be viewed with the external drives disconnected. So my question is this. Am I able to change the location of the preview files to be on my OTHER internal hard drive (non-SSD, much larger), so that they're still available without the external drives, but are not cluttering up my startup drive. And, if not, what should I do!?
    Thanks a lot

    Glad it worked, but permit, if you will, some observations:
    -- Bloated Previews are a known Aperture bug, which came and went  within a few updates in Aperture 3. Getting them back to the proper size is simply a elegant step to take.
    -- A Preview set to your largest screen size and a quality of 6-8 should be all but indistinguishable from the Master at 72-100 dpi screen image. (Not print resolution.) I REALLY doubt you are going to loose any quality.
    -- While using a symlink to stick the Previews on a HD is clever, it may also defeat the whole purpose of using your SSD. Previews are read a lot and are, I suspect, used for all adjustments at less than full resolution. (N.B. I could be VERY wrong on this.) Thus, depending on the amount of RAM on your Mac, you could end up reading and rereading your Previews over a slower link and doing this a lot. You own use will quickly determine if this is an issue or not.
    I have blathered on, at length, about what I think matters for size and speed here: https://discussions.apple.com/message/17959625#17959625. Some of this may be of use.
    I went through a lot of these issues when I tried to fit everything on a 128 GB SSD, so I know some of the issues you are facing. As I noted before, you really only need a Library (minus most Masters) of about 30 GB and that is with large, high quality Previews.
    I actually took the SSD out and stuck it in an ancient MacBookPro (in preparation for a trip to Blighty this summer) and have not noticed a huge drop in Aperture speed. (I do miss the speed of applications launch, restart, however.) One thing that I did find that made a small, but nice difference, was keeping all of the Masters on a separate, dedicated drive. Once defragged, etc. that was very fast. Don't know if you could achieve the same results by partitioning a larger drive, but it might well be fun to find out.
    DiploStrat

  • How to get the size of the file

    Hi All,
    I want to get the size of the file in terms of bytes. I used the following code it returns the value in long how can get it in bytes
    import java.io.File;
    public class ServerBackupCheck {
         public static void main(String args[]){
              File f = new File("C:/Program Files/Apache Software Foundation/Tomcat 5.5");
              System.out.println(f.isDirectory());
              System.out.println(f.getTotalSpace());
    output:
    true
    20964163584
    regards,
    Maheshwaran Devaraj

    if it is a folder you can use this recursive algorithm
    public static long recurse(File f) throws IOException
              long bytes = 0;
              File files[] = f.listFiles();
              for(int i =0 ;i<files.length;i++)
                   File file = files ;
                   if(file.isFile())
                        FileInputStream fis = new FileInputStream(file);
                        byte[] by = new byte[fis.available()];
                        fis.read(by);
                        bytes = bytes + by.length;
                   if(file.isDirectory())
                        bytes = bytes + recurse(file);
              return bytes;
    System.out.println(recurse(f));  gives you the total bytes....
    Ayberk Cansever ..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • How can I debug a Bulk Insert error?

    I'm loading a bunch of files into SQL server.  All work fine, but one keeps erroring out on me.  All files should be exactly the same in structure, but they have different dates, and other different financial metrics, but the structure and field name

  • I get this error with iCal "generates a conflict" when synced with my Yahoo calendar. Help Please

    I updated to Maverick "Mistake" and have been getting this error since "generates a conflict" with the new iCal and my Yahoo calanders. There werent any problems before the update. Any suggestions as to how to fix it ? Does anyone know how to go back

  • Deleting a segment in an IDOC - XI - IDOC Scenario

    Hi I am relatively new to XI. I would appreciate any help on the following issue. I have a requirement to send Material Master information from one R/3 system to multiple R/3 systems via XI. These IDOCs have multiple segments for the Description segm

  • Help with html dataset filter please

    Hi, I'm using an html dataset as source of product display, showing products by age (age deduced from 'year' of production) on different pages but all using same html dataset Currently I use spry:if to find eg 2 year old products shown on the 2 year

  • Aspect ratio is off for tiffs

    Hi all, new to this forum. I usually hang out in the Photoshop forum as I use PSCS. Amy how, here at work I have been given Elements 6 for working with our TIFF files. When they're opened in Elements, they are way to narrow looking. I have the rulers