Parent « Container « Java Swing Q&A





1. Swing: How to achieve forwarding of all events from subcomponents to parent container?    stackoverflow.com

I'm looking for a straightforward way to make a Swing component forward all received events to its parent container (or even all parents up to root). EDIT:
Where do I need this? I ...

3. adding container's parent to itself error    coderanch.com

Problem code : private void tryM (StyledDocument textPaneU, int integerF, String stringA, SimpleAttributeSet attributesJ) { //This is the method try { textPaneU.insertString(integerF, stringA, attributesJ); } catch(Exception eafff) { eafff.printStackTrace(); } } //Later...This is it being used... StyledDocument fqDOC = new DefaultStyledDocument(); SimpleAttributeSet fqPaneAttrs = new SimpleAttributeSet(); JTextPane fqPane = new JTextPane(fqDOC); fqPaneAttrs.addAttribute(StyleConstants.CharacterConstants.Foreground, Color.green); JScrollPane fqScroll = new JScrollPane(fqPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); tryM(fqDOC,0,"Test ...

4. [SOLVED] Coordinates container --> in parent container.    java-forums.org

I have a listener on each of many small panels inside a big one. Then, when an event occurs, the Event object has stored coordinates relative to the small panel that invoked the event. Is there a way to find the coordinades of the event relative to the big parent panel? Or do I have to use screen coordinates?