Prevent JScrollpane from scrolling... + JTextPane

hello,
i've a JScrollPane(JTextPane) which displays html-code provided by the setText()-method. but i'd like the JScrollPane NOT to scroll automatically to the bottom when the programm inserts new html-code with setText(). setting the JScrollBar-Value doesn't work. I need something to prevent the JScrollBar from scrolling....
by the way, does anyone know a way to append text to a JTextPane (line by line)... JTextPane provides only a setText()-method which overwrites the old content with the new text... i'd like to append it....
thanks,
andi

This has taken me over a year to figure out. I spent lots of time trying to set the viewport back to the top or moving the scroll bar back to the top. I even tried inserting text at the very begining. None of this works. What does work is setting the cursor (caret) to the begining of the text pane after you add the text. Something like this:
document.insertString(document.getLength(),"...lots of text...",attr);
textPane.getCaret().setDot(0); << the big secret
Pretty easy huh?

Similar Messages

  • Preventing JScrollPane from scrolling when contents change

    I have an application where I have a large panel of information that is constantly being updated over time. I found a need to put more information on the panel than I could fit on my screen, so I put everything in a JScrollPane.
    This works to a degree, but I find that as things in the panel get updated (JTextAreas are an example) the JScrollPane scrolls wildly about. I think it is trying to show components that have changed. I would prefer that it NEVER scroll on its own since the whole panel will be updating at any given time.
    Does anyone know if there is a way to turn off this behavior? I set the preferred/minimum/maximum size on the JPanel that goes inside the JScrollPane to keep it a constant size, but that doesn't solve the problem. If someone can help me, I'd really appreciate it. Thanks!

    Off the top of my head, I can think of at least two action events that are fired by a JComboBox, one has to do with selection being made and another is comboBoxEdited. If you want to do something only when an item in the combo box is selected, then you should programmatically ignore the later.
    If you're doing other changes your self, you can always remove the listener from the combobox, make the changes, and then add the listener back.
    ;o)
    V.V.

  • Stop JScrollPane from scrolling

    Hello, I am trying to improve a special editor i have written. Now I tried to add line numbering to it and got stuck. Here's what I did:
    I have a JScrollPane that contains a JPanel. This JPanel has a BorderLayout and contains a JTextPane (where the editable text is) in the CENTER and a JTextArea (containing the line numbers) in the WEST.
    Everytime the text is edited, I count the lines and update the JTextArea so that the right amount of line numbers is shown. But here's the problem: Everytime I update the line numbers, the JScrollPane scrolls down to the very bottom, so in some cases the caret gets hidden (which is very annoying).
    Can someone tell me how I can tell the JScrollPane (or whoever else is to blame for this) not to scroll when I update the line number JTextArea? Is there an easy way to achieve this?
    Thanks in advance

    Another way to do this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.rtf.*;
    class Test extends JFrame
    public Test()
    super("Test");
    JEditorPane edit = new JEditorPane();
    edit.setEditorKit(new MyRTFEditorKit());
    edit.setEditable(true);
    JScrollPane scroll=new JScrollPane(edit);
    getContentPane().add(scroll);
    setSize(300,300);
    setVisible(true);
    public static void main(String a[])
    new Test();
    class MyRTFEditorKit extends RTFEditorKit
    public ViewFactory getViewFactory()
    return new MyRTFViewFactory();
    class MyRTFViewFactory implements ViewFactory
    public View create(Element elem)
    String kind = elem.getName();
    if (kind != null)
    if (kind.equals(AbstractDocument.ContentElementName)) {
    return new LabelView(elem);
    } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
    // return new ParagraphView(elem);
    return new MyParagraphView(elem);
    } else if (kind.equals(AbstractDocument.SectionElementName)) {
    // return new BoxView(elem, View.Y_AXIS);
    return new MySectionView(elem, View.Y_AXIS);
    } else if (kind.equals(StyleConstants.ComponentElementName)) {
    return new ComponentView(elem);
    } else if (kind.equals(StyleConstants.IconElementName)) {
    return new IconView(elem);
    // default to text display
    return new LabelView(elem);
    class MySectionView extends BoxView {
    public MySectionView(Element e, int axis)
    super(e,axis);
    public void paintChild(Graphics g,Rectangle r,int n) {
    if (n>0) {
    MyParagraphView child=(MyParagraphView)this.getView(n-1);
    int shift=child.shift+child.childCount;
    MyParagraphView current=(MyParagraphView)this.getView(n);
    current.shift=shift;
    super.paintChild(g,r,n);
    class MyParagraphView extends javax.swing.text.ParagraphView
    public int childCount;
    public int shift=0;
    public MyParagraphView(Element e)
    super(e);
    short top=0;
    short left=20;
    short bottom=0;
    short right=0;
    this.setInsets(top,left,bottom,right);
    public void paint(Graphics g, Shape a)
    childCount=this.getViewCount();
    super.paint (g,a);
    int rowCountInThisParagraph=this.getViewCount();
    System.err.println(rowCountInThisParagraph);
    public void paintChild(Graphics g,Rectangle r,int n) {
    super.paintChild(g,r,n);
    g.drawString(Integer.toString(shift+n+1),r.x-20,r.y+r.height-3);

  • How do I prevent Spacebar from scrolling mail?

    I am using a Yotpo Social review system that sends HTML emails containing a form for submitting product reviews.
    The problem I have in Mavericks is that the space key does not work when entering text in the input fields. Rather than entering a space, either the email will scroll to the bottom of the message, or the next message in the message list will highlight, thus removing focus from the input field.
    Is there a way to disable spacebar scrolling in Mail.app so I can type a space character in an HTML form?
    Thanks for any suggestions.
    Chris

    I am using a Yotpo Social review system that sends HTML emails containing a form for submitting product reviews.
    The problem I have in Mavericks is that the space key does not work when entering text in the input fields. Rather than entering a space, either the email will scroll to the bottom of the message, or the next message in the message list will highlight, thus removing focus from the input field.
    Is there a way to disable spacebar scrolling in Mail.app so I can type a space character in an HTML form?
    Thanks for any suggestions.
    Chris

  • How do I prevent website from scrolling horizontally in Dreamweaver?

    I have created a website that (although I'm not seeing scrolling on my computer and 2 others across multiple browsers) has a horizontal scroll bar when my client views on her computer. I am having problems troubleshooting since I can't see the problem so clearly. I am a little behind the curve on creating fully responsive sites and am convinced that something I did to make these responsive created the problem. If possible, can anyone take a look at the code for the links and tell me if you see any obvious corrections that I can make in Dreamweaver or to the code to make the pages horizontally stationary with no horizontal scroll bar? Please let me know if you require more information and what that is.
    Link 1: http://www.impressionsofbeauty.com/
    Link 2: http://impressionsofbeauty.com/corporate_indexb.html
    Any assistance would be greatly appreciated.

    Your code is messed up.  And you neglected to upload the Bootstrap folder with supporting scripts and CSS code.  You also didn't upload your BG image because it's nowhere to be found.  This is where it should be:
    http://impressionsofbeauty.com/IMAGES/fluidbackground.jpg
    Copy & paste this code into a new, blank document.  Save as test.html and try again.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 TEST PAGE</title>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.css" />
    <script src="bootstrap/js/jquery.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <!--custom web fonts-->
    <link href="bootstrap/css/bootstrap-responsive.css?family=Titillium+Web:400,200,200italic|Ralew ay:400,200|Oswald:400,700.css" rel="stylesheet" type="text/css" />
    <link href="css/fluid.css?family=Titillium+Web|400,200,200italic|Raleway|400,200|Oswald|400,700 .css" rel="stylesheet" type="text/css" />
    <style>
    body {
    font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
    font-size: 1em;
    color: #CCC;
    margin: 0;
    padding: 0;
    /**scalable background image**/
    background: #131313 url(IMAGES/fluidbackground.jpg) no-repeat center center fixed;
    /**for Safari,Chrome**/
    -webkit-background-size: cover;
    /**for Firefox**/
    -moz-background-size: cover;
    /**for Opera**/
    -o-background-size: cover;
    /**for other browsers**/
    background-size: cover;
    </style>
    </head>
    <body>
    <div class="container-fluid">
    <div class="row-fluid">
    <div class="span12">
    <h1>Site Name</h1>
    <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
    <h2>Heading 2</h2>
    <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
    <h3>Heading 3</h3>
    <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
    <!--end span12--></div>
    <!--end row-fluid--></div>
    <!--end container-fluid--></div>
    </body>
    </html>
    Nancy O.

  • Stop scroll bar in JScrollPane from updating viewport when dragging knob

    Hi,
    Does anyone know if it's possible to stop the JScrollPane from updating the viewport whilst dragging the knob of the scrollbar and only update once released.
    The problem I have is that the view of the scroll panes viewport is a JList that has an underlying model of a RandomAccessFile which can be very large. So when the user is dragging the scrollbars it will be accessing the file system to retrieve the relevant data for the JList.
    I've tried creating my own JScrollBar and adding a AdjustmentListener to ignore events whilst dragging:
    class MyAdjustmentListener implements AdjustmentListener {
    // This method is called whenever the value of a scrollbar is changed,
    // either by the user or programmatically.
    public void adjustmentValueChanged(AdjustmentEvent evt) {
    Adjustable source = evt.getAdjustable();
    // getValueIsAdjusting() returns true if the user is currently
    // dragging the scrollbar's knob and has not picked a final value
    if (evt.getValueIsAdjusting()) {
    // The user is dragging the knob
    return;
    Looking through the JScrollBar code it has a model that will fire adjustment events anyway, which I suppose are being picked up by the JScrollPane somewhere.
    I could use my own JScrollBar and not add it to the scroll pane and process the adjustment events myself and update the JList but I was wondering if there is a better way.
    Many Thanks,
    Martin.

    Two small changes seem to do the trick. You may want to test it thoroughly though ;)import javax.swing.BoundedRangeModel;
    import javax.swing.DefaultBoundedRangeModel;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollBar;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    public class OneStepScroller {
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new OneStepScroller().makeUI();
       public void makeUI() {
          Object[] data = new Object[200];
          for (int i = 0; i < data.length; i++) {
             data[i] = "Item Number " + i;
          JList list = new JList(data);
          JScrollPane scrollPane = new JScrollPane(list);
          BoundedRangeModel model = scrollPane.getVerticalScrollBar().getModel();
          final JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
          scrollBar.setModel(new DefaultBoundedRangeModel(model.getValue(),
                model.getExtent(), model.getMinimum(), model.getMaximum()) {
             int oldValue;
             @Override
             public int getValue() {
                // changed here
                if (!getValueIsAdjusting() && !(oldValue == super.getValue())) {
                   oldValue = super.getValue();
                   // added this
                   fireStateChanged();
                return oldValue;
          JFrame frame = new JFrame("");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400, 400);
          frame.setLocationRelativeTo(null);
          frame.add(scrollPane);
          frame.setVisible(true);
    }db

  • Home Sharing prevents iPod playlist menu from scrolling‽

    I've run into a problem where my playlist menu can become hidden underneath the "Now Playing" box in the iPod app on the iPad 1. The menu can scroll, but as soon as I lift my finger the bottom playlists drop back underneath the "Now Playing" box. This prevents me from selecting them. The culprit is Home Sharing. As soon as I have a WiFi connection, Home Sharing kicks in and the "Library" option appears at the top left. From this point on, the bottom of my playlists becomes unaccessible.
    The obvious solution is to either shut off Home Sharing (which I have done in preferences on my iPad. It's painfully slow anyway, especially compared to using the Remote app) or I could sync fewer playlists. But neither solution is elegant. This should just work. I was wondering if anybody else had run into this problem, and I was wondering if you had heard of a solution.
    Here's a screen cap of the issue: https://skitch.com/darkstream/r7iku/ipad-home-sharing-menu-glitch

    I didn't realize we could post pix now, so here is the linked graphic so you don't have to leave this site.
    Looks like somebody else has run into this problem (https://discussions.apple.com/message/15005124#15005124). They found a workaround using Search, but I haven't tried it yet. I'm hoping other people will sound off here. I'm curious to know if others have experienced this.

  • How can we prevent JTabbedPanes from transferring focus to components outside of the tabs during tab traversal?

    Hi,
    I noticed a strange focus traversal behavior of JTabbedPane.
    During tab traversal (when the user's intention is just to switch between tabs), the focus is transferred to a component outside of the tabs (if there is a component after/below the JTabbedPane component), if using Java 6. For example, if using the SSCCE below...
    import java.awt.BorderLayout;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class TabbedPaneTest extends JPanel {
        public TabbedPaneTest() {
            super(new BorderLayout());
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Tab 1", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            tabbedPane.addTab("Tab 2", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            tabbedPane.addTab("Tab 3", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            tabbedPane.addTab("Tab 4", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(tabbedPane);
            JButton button = new JButton("Dummy component that gains focus when switching tabs");
            panel.add(button, BorderLayout.SOUTH);
             * To replicate the focus traversal issue, please follow these steps -
             * 1) Run this program in Java 6; and then
             * 2) Click on a child component inside any tab; and then
             * 3) Click on any other tab (or use the mnemonic keys ALT + 1 to ALT 4).
            button.addFocusListener(new FocusAdapter() {
                @Override
                public void focusGained(FocusEvent e) {
                    System.err.println("Gained focus (not supposed to when just switching tabs).");
            add(new JScrollPane(panel));
        private JPanel buildPanelWithChildComponents() {
            JPanel panel = new JPanel();
            BoxLayout boxlayout = new BoxLayout(panel, BoxLayout.PAGE_AXIS);
            panel.setLayout(boxlayout);
            panel.add(Box.createVerticalStrut(3));
            for (int i = 0; i < 4; i++) {
                panel.add(new JTextField(10));
                panel.add(Box.createVerticalStrut(3));
            return panel;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test for Java 6");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.add(new TabbedPaneTest());
                    frame.pack();
                    frame.setVisible(true);
    ... Then we can replicate this behavior by following these steps:
    1) Run the program in Java 6; and then
    2) Click on a child component in any of the tabs; and then
    3) Click on any other tab (or use the mnemonic keys 'ALT + 1' to 'ALT + 4').
    At step 3 (upon selecting any other tab), the focus would go to the component below the JTabbedPane first (hence the printed message in the console), before actually going to the selected tab.
    This does not occur in Java 7, so I'm assuming it is a bug that is fixed. And I know that Oracle suggests that we should use Java 7 nowadays.
    The problem is: We need to stick to Java 6 for a certain application. So I'm looking for a way to fix this issue for all our JTabbedPane components while using Java 6.
    So, is there a way to prevent JTabbedPanes from passing the focus to components outside of the tabs during tab traversal (e.g. when users are just switching between tabs), in Java 6?
    Note: I've read the release notes between Java 6u45 to Java 7u15, but I was unable to find any changes related to the JTabbedPane component. So any pointers on this would be deeply appreciated.
    Regards,
    James

    Hi Kleopatra,
    Thanks for the reply.
    Please allow me to clarify first: Actually the problem is not that the child components (inside tabs) get focused before the selected tab. The problem is: the component outside of the tabs gets focused before the selected tab. For example, the JButton in the SSCCE posted above gets focused when users switch between tabs, despite the fact that the JButton is not a child component of the JTabbedPane.
    It is important for me to prevent this behavior because it causes a usability issue for forms with 'auto-scrolling' features.
    What I mean by 'auto-scrolling' here is: a feature where the form automatically scrolls down to show the current focused component (if the component is not already visible). This is a usability improvement for long forms with scroll bars (which saves the users' effort of manually scrolling down just to see the focused component).
    To see this feature in action, please run the SSCCE below, and keep pressing the 'Tab' key (the scroll pane will follow the focused component automatically):
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.JViewport;
    import javax.swing.SwingUtilities;
    public class TabbedPaneAutoScrollTest extends JPanel {
        private AutoScrollFocusHandler autoScrollFocusHandler;
        public TabbedPaneAutoScrollTest() {
            super(new BorderLayout());
            autoScrollFocusHandler = new AutoScrollFocusHandler();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Tab 1", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            tabbedPane.addTab("Tab 2", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            tabbedPane.addTab("Tab 3", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            tabbedPane.addTab("Tab 4", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(tabbedPane);
            JButton button = new JButton("Dummy component that gains focus when switching tabs");
            panel.add(button, BorderLayout.SOUTH);
             * To replicate the focus traversal issue, please follow these steps -
             * 1) Run this program in Java 6; and then
             * 2) Click on a child component inside any tab; and then
             * 3) Click on any other tab (or use the mnemonic keys ALT + 1 to ALT 4).
            button.addFocusListener(new FocusAdapter() {
                @Override
                public void focusGained(FocusEvent e) {
                    System.err.println("Gained focus (not supposed to when just switching tabs).");
            button.addFocusListener(autoScrollFocusHandler);
            JScrollPane scrollPane = new JScrollPane(panel);
            add(scrollPane);
            autoScrollFocusHandler.setScrollPane(scrollPane);
        private JPanel buildPanelWithChildComponents(int numberOfChildComponents) {
            final JPanel panel = new JPanel(new GridBagLayout());
            final String labelPrefix = "Dummy Field ";
            final Insets labelInsets = new Insets(5, 5, 5, 5);
            final Insets textFieldInsets = new Insets(5, 0, 5, 0);
            final GridBagConstraints gridBagConstraints = new GridBagConstraints();
            JTextField textField;
            for (int i = 0; i < numberOfChildComponents; i++) {
                gridBagConstraints.insets = labelInsets;
                gridBagConstraints.gridx = 1;
                gridBagConstraints.gridy = i;
                panel.add(new JLabel(labelPrefix + (i + 1)), gridBagConstraints);
                gridBagConstraints.insets = textFieldInsets;
                gridBagConstraints.gridx = 2;
                textField = new JTextField(22);
                panel.add(textField, gridBagConstraints);
                textField.addFocusListener(autoScrollFocusHandler);
            return panel;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test for Java 6 with auto-scrolling");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.add(new TabbedPaneAutoScrollTest());
                    frame.setSize(400, 300);
                    frame.setVisible(true);
    * Crude but simple example for auto-scrolling to focused components.
    * Note: We don't actually use FocusListeners for this feature,
    *       but this is short enough to demonstrate how it behaves.
    class AutoScrollFocusHandler extends FocusAdapter {
        private JViewport viewport;
        private JComponent view;
        public void setScrollPane(JScrollPane scrollPane) {
            viewport = scrollPane.getViewport();
            view = (JComponent) viewport.getView();
        @Override
        public void focusGained(FocusEvent event) {
            Component component = (Component) event.getSource();
            view.scrollRectToVisible(SwingUtilities.convertRectangle(component.getParent(),
                    component.getBounds(), view));
    Now, while the focus is still within the tab contents, try to switch to any other tab (e.g. by clicking on the tab headers, or by using the mnemonic keys 'ALT + 1' to 'ALT + 4')...
    ... then you'll notice the following usability issue:
    1) JRE 1.6 causes the focus to transfer to the JButton (which is outside of the tabs entirely) first; then
    2) In response to the JButton gaining focus, the 'auto-scrolling' feature scrolls down to the bottom of the form, to show the JButton. At this point, the tab headers are hidden from view since there are many child components; then
    3) JRE 1.6 transfers the focus to the tab contents; then
    4) The 'auto-scrolling' feature scrolls up to the selected tab's contents, but the tab header itself is still hidden from view (as a side effect of the behavior above); then
    5) Users are forced to manually scroll up to see the tab headers whenever they are just switching between tabs.
    In short, the tab headers will be hidden when users switch tabs, due to the Java 6 behavior posted above.
    That is why it is important for me to prevent the behavior in my first post above (so that it won't cause usability issues when we apply the 'auto-scrolling' feature to our forms).
    Best Regards,
    James

  • I have an Apple MacBook Pro and when surfing the web my computer will slow to a crawl and I will have a multi-colored spinning wheel visible until my latest request is handled.  What is causing this and is there a way to prevent this from occuring

    I have a MacBook Pro.  When surfing the web it will eventually slow to a crawl.  When this occurs, there will be a small multi-colored wheel spinning until my latest command is handled.  What is causing this and is there a way that I can modify or prevent this from happening?  Is there a setting that will prevent this?

    When you next have the problem, note the exact time: hour, minute, second.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Scroll back in the log to the time you noted above. Select any messages timestamped from then until the end of the episode, or until they start to repeat. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Something is preventing me from opening attachements or using bottom of the screen in emails

    Can someone please help? For some reason there seems to be a small black triangle, like a tab set, on my screen preventing me from being able to use the bottom of my screen to scroll or open attachments. I can use the screen to scroll for all other apps but when I open my e-mail I can only use the upper portion of my screen to scroll and the bottom portion is locked out right where the triangle tab starts. Does anyone know why and how I can remove this?

    I apologize for this reply being so late.  Your idea was great but I am already operating at the largest dimensions.  The problem got temporarily solved when I installed the latest OS update but it has now returned.  As well, the follow-up from Apple gave me the option of marking your suggestion as "correct answer" or "helpful answer" and I'm sorry but I can't say either.  I have no idea what to try next -  other than to wait for another update to OS X 10.

  • When I disconnect my iphone 3gs(iOS) from computer, the device disappears from my itunes. This prevents me from doing a wireless sync. how do i fix it so that my device stays on itunes without having to plug it in all the time?

    When I disconnect my iphone 3gs(iOS) from computer, the device disappears from my itunes. This prevents me from doing a wireless sync. how do i fix it so that my device stays on itunes without having to plug it in all the time?
    it worked the first few times i did it but the next day after i closed out of itunes once, the device only appears when i plug in my phone.

    Whenever a menu choice is grayed out, that is because you have Restrictions turned on in Settings.  Be sure to turn it off.
    You are confusing an itunes store account with an icloud account.  You two can continue using the same ID for itunes (thus sharing purchased music, apps, etc.), but you really should have separate accounts (different IDs) for icloud, since an account is intended for one user to keep his/her devices in sync.
    To create a new icloud account, go to
    http://www.apple.com/icloud/setup/
    Then go to Settings>icloud and scroll to the bottom of the screen and tap Delete Account.  (have restrictions turned off)  That will disconnect the device from the account but will not delete data in icloud or other devices.  Then sign in using the new ID.

  • Need debugging help: Why is JScrollPane auto-scrolling?

    I'm trying to figure out why when I double-click on a cell within a JTable that's wrapped in a JScrollPane in order to open up another window, the JScrollPane automatically scrolls to the top.
    Even when I update the double click operation to simply call setSelected(false), the JScrollPane still automatically scrolls to the top.
    I added myself as a change listener to the scroll pane's row header view port, and captured the following stack trace.
    I'm having trouble debugging exactly what is causing the following chain of events to fire. If I try to put a debug breakpoint on a method like EventQueue.invokeLater() that's probably initiating the following chain of events, I can't even get back to my application window from my IDE without having to dismiss all of the breakpoints that are reached.
    If I try to follow through from the double-click to the actual JScrollPane auto-scroll, I get lost in a maze of Swing events that I can't navigate out of.
    Any suggestions on how to appropriately debug this would be greatly appreciated.
    Thanks,
    Mike
    rowHeaderViewPort stateChanged fired
    chgEvent == javax.swing.event.ChangeEvent[source=javax.swing.JViewport[,1,21,0x329,invalid,layout=javax.swing.ViewportLayout,alignmentX=null,alignmentY=null,border=,flags=8,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=0,height=0],isViewSizeSet=false,lastPaintPosition=,scrollUnderway=false]]
    chgEvent source == javax.swing.JViewport[,1,21,0x329,invalid,layout=javax.swing.ViewportLayout,alignmentX=null,alignmentY=null,border=,flags=8,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=0,height=0],isViewSizeSet=false,lastPaintPosition=,scrollUnderway=false]
    java.lang.Exception: stack trace
         at MyForm$2.stateChanged(MyForm.java:192)
         at javax.swing.JViewport.fireStateChanged(JViewport.java:1341)
         at javax.swing.JViewport.setViewPosition(JViewport.java:1096)
         at javax.swing.ViewportLayout.layoutContainer(ViewportLayout.java:179)
         at java.awt.Container.layout(Container.java:1020)
         at java.awt.Container.doLayout(Container.java:1010)
         at java.awt.Container.validateTree(Container.java:1092)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validateTree(Container.java:1099)
         at java.awt.Container.validate(Container.java:1067)
         at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:353)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:116)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    Thanks for your response. I examined the code and nowhere that I can see is it calling either of those two methods.
    At some point, it looks like something within my code or in the UI frameworks that I'm using is invalidating my JScrollPane. I'm having a very difficult time, though, tracking down exactly which component is causing that invalidation.
    Short of writing my own JScrollPane so that I can capture the stack trace of calls to invalidate(), does anyone have any suggestions for debugging this further? I tried to use a conditional breakpoint in Eclipse 2.1.3 (Component.invalidate() where the Component is an instance of JScrollPane), but my breakpoint is never being executed.
    Thanks,
    Mike

  • Why do bookmarks go automatically in "recently bookmarned" rather than folder i choose; how keep book mark list from scrolling

    when i create a new bookmark, it is automatically filed in "recently bookmarked" rather than the folder i choose. when i subsequently go to the "recently bookmarked" folder, drag and drop the bookmark in a different folder, there will be 1 in the folder that i choose and 2 in the "recently bookmarked" folder; if i delete both bookmarks in the "recently bookmarked" folder, it will delete the link in the folder that i originally tried to move it to.
    1. how to save new bookmarks in the folder i choose
    2. how to move bookmarks from "recently bookmarked" folder permanently
    3. remove the default setting of where the bookmarks go
    another problem is preventing the bookmark list from scrolling - i detest it and would like to turn this option off!

    Your bookmarks are most like stored in the Unsorted bookmarks folder if you have created them by clicking the star in the location bar.<br />
    You can click the highlighted star another time to open the "Edit This Bookmark" dialog and move the bookmark to another folder.
    *https://support.mozilla.org/kb/how-do-i-use-bookmarks
    * "Most Visited" and "Recently Bookmarked" and "Recent Tags" are examples of so called [[Smart Bookmarks folders|Smart Bookmarks folders]] and are not real existing folders.
    * Such smart folders show a list created by a query of the places.sqlite database that stores the bookmarks and the history in Firefox.
    * Smart folder lists show a maximum of 10 entries by default.
    * Bookmarks or history items that show up in a smart folder list are stored elsewhere in another folder and any changes made are applied to the real bookmark or history item.
    * Actions like copy & paste or delete that you perform on bookmarks in such a list are done on the original bookmark.

  • Adding a JScrollPane to a JTextPane

    Hi,
    I'm having problems adding a JScrollPane to a JTextpane. I expected you could add it just as you do with a JTextPane but for some reason it does not appear. Here is the code:
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    class ChatRoom extends JFrame implements ActionListener
         private     DefaultStyledDocument     doc;
         private     JTextPane                    pane;
         private JButton blueb, yellowb, redb, cyanb;
         private StyleContext sc;
         private JScrollPane scroll;
         public ChatRoom()
              setTitle( "Document     Handling Application" );
              setSize( 300, 190 );
              setBackground( Color.gray );
              JPanel topPanel     = new JPanel( new BorderLayout() );
              getContentPane().add( topPanel );
              // Create styles for the document
              sc = new StyleContext();
              doc = new DefaultStyledDocument( sc );
              // Create a text pane to display text
              pane = new JTextPane( doc );
              pane.setBackground( Color.white );
              pane.setEditable(false);
              scroll = new JScrollPane(pane);
              scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              topPanel.add( pane, BorderLayout.CENTER );
              blueb = new JButton("Blue");
              blueb.setBackground(Color.blue);
              blueb.addActionListener(this);
              yellowb = new JButton("Yellow");
              yellowb.setBackground(Color.yellow);
              yellowb.addActionListener(this);
              redb = new JButton("Red");
              redb.setBackground(Color.red);
              redb.addActionListener(this);
              cyanb = new JButton("Cyan");
              cyanb.setBackground(Color.cyan);
              cyanb.addActionListener(this);
              JPanel buttonPanel = new JPanel();
              buttonPanel.add(blueb);
              buttonPanel.add(yellowb);
              buttonPanel.add(redb);
              buttonPanel.add(cyanb);
              topPanel.add(buttonPanel, BorderLayout.SOUTH );
         // Handle changes to the combobox (style changes)
         public void actionPerformed( ActionEvent e )
              MutableAttributeSet attr = new SimpleAttributeSet();
              if(e.getSource() == blueb) {
                   StyleConstants.setForeground(attr, Color.blue);
              if(e.getSource() == yellowb) {
                   StyleConstants.setForeground(attr, Color.yellow);
              if(e.getSource() == redb) {
                   StyleConstants.setForeground(attr, Color.red);
              if(e.getSource() == cyanb) {
                   StyleConstants.setForeground(attr, Color.cyan);
              pane.setCharacterAttributes(attr, false);
              try { doc.insertString( pane.getCaret().getDot(), "Hello \n", attr ); }
              catch( BadLocationException exception ) {}
              pane.grabFocus();
         // Main() method to     get     the ball rolling
         public static void main( String args[] )
              // Create an instance of the test application
              ChatRoom mainFrame     = new ChatRoom();
              mainFrame.setVisible( true );
    }Thanks
    Cath

    yeah sorry, i'm being realy dumb :-), thanks very much for your help!
    Cath

  • How do I prevent Adobe from taking my jpegs and making them pdf files? I have had to uninstall Adobe to access my photos as jpegs.

    How do I prevent Adobe from taking my jpegs and making them pdf files? I have had to uninstall Adobe to access my photos as jpegs.

    I would suggest you change your file associations so that jpgs open in a program other than Acrobat.  Assuming you have a Windows machine, just go to the Start, and search for "file associations" ... it's part of the Control Panel.
    Scroll down to the file type jpg, and set it to open with whatever graphic preview or editing program you have that you want to use as the default.  From that point on, when you click on a jpg, it should not open Acrobat and instantly try to convert it to a pdf.

Maybe you are looking for