How to set SplinPane Borders like MS Outlook?

Hi All, this is my 2nd Topic :-)
Platform: Win2000 SVP2, 512 MB, P IV 1,5
JDK 1.3.002
I think that a lot of people the MS Outlook Layout knows.
I build currently a prototype for a Buisness Application.
My Problem is:
2 SplitPanes
SP1 = a Bitmap Menu (like MS Outlook)
| P1 | P2 |
| | | |
SP2 = a Tree & a Table
I try a lot of thinks to "disable" the Bitmapmenu on the right side of the first Splitpane.
Problem: i can hidden the Bitmapmenu but i can�t resize
the Splitpane2 so that she use the room of the Bitmap menu, SP2 is still on the same position and on the left side is only a gray panel. For a Solution i will give 3 Duke Dollars!

I just solved such a problem...
what you need is an auto resize jsliptpane: that meens it removes a component from the split pane if not viewed and then recalculate its size.
here is the class:
import javax.swing.JSplitPane;
import javax.swing.JPanel;
import javax.swing.JComponent;
import java.awt.Component;
import java.awt.BorderLayout;
* This class extends the JSplitPane class in order to offer a split pane that
* resizes itself automatically if a component is added or removed.
* @author Taoufik Romdhane
* @version 1.0
public class AutoResizeSplitPane extends JPanel
* Vertical split indicates the <code>Component</code>s are
* split along the y axis. For example the two
* <code>Component</code>s will be split one on top of the other.
public final static int VERTICAL_SPLIT = 0;
* Horizontal split indicates the <code>Component</code>s are
* split along the x axis. For example the two
* <code>Component</code>s will be split one to the left of the
* other.
public final static int HORIZONTAL_SPLIT = 1;
* The split pane orientation.
private int orientation;
* The internal split pane.
private JSplitPane splitPane;
* The right component.
private JComponent rightComponent;
* The left component.
private JComponent leftComponent;
* The split pane state, if showing the splitter or not.
private boolean isSplitterVisible;
* The auto resize split pane ui.
private BorderLessSplitPaneUI borderLessSplitPaneUI;
* Creates a new <code>AutoResizeSplitPane</code> configured with the
* specified orientation and no continuous layout.
* @param newOrientation <code>AutoResizeSplitPane.HORIZONTAL_SPLIT</code> or
* <code>AutoResizeSplitPane.VERTICAL_SPLIT</code>
* @exception IllegalArgumentException if <code>orientation</code>
*          is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
public AutoResizeSplitPane(int newOrientation)
super(new BorderLayout());
splitPane = new BorderLessSplitPane(newOrientation);
orientation = newOrientation;
borderLessSplitPaneUI = new BorderLessSplitPaneUI();
splitPane.setUI(borderLessSplitPaneUI);
splitPane.setDividerSize(3);
isSplitterVisible = false;
* Removes the child component, <code>component</code> from the
* pane. Resets the <code>leftComponent</code> or
* <code>rightComponent</code> instance variable, as necessary.
* @param component the <code>Component</code> to remove
public void remove(Component component)
splitPane.remove(component);
super.remove(splitPane);
update();
* Sets the component to the left (or above) the divider.
* @param comp the <code>Component</code> to display in that position
public void setLeftComponent(Component comp)
leftComponent = (JComponent)comp;
splitPane.setLeftComponent(comp);
* Returns the component to the left (or above) the divider.
* @return the <code>Component</code> displayed in that position
* @beaninfo
* preferred: true
* description: The component to the left (or above) the divider.
public Component getLeftComponent()
return splitPane.getLeftComponent();
* Sets the component above, or to the left of the divider.
* @param comp the <code>Component</code> to display in that position
* @beaninfo
* description: The component above, or to the left of the divider.
public void setTopComponent(Component comp)
leftComponent = (JComponent)comp;
splitPane.setLeftComponent(comp);
* Returns the component above, or to the left of the divider.
* @return the <code>Component</code> displayed in that position
public Component getTopComponent()
return splitPane.getTopComponent();
* Sets the component to the right (or below) the divider.
* @param comp the <code>Component</code> to display in that position
* @beaninfo
* preferred: true
* description: The component to the right (or below) the divider.
public void setRightComponent(Component comp)
rightComponent = (JComponent)comp;
splitPane.setRightComponent(comp);
* Returns the component to the right (or below) the divider.
* @return the <code>Component</code> displayed in that position
public Component getRightComponent()
return splitPane.getRightComponent();
* Sets the component below, or to the right of the divider.
* @param comp the <code>Component</code> to display in that position
* @beaninfo
* description: The component below, or to the right of the divider.
public void setBottomComponent(Component comp)
rightComponent = (JComponent)comp;
splitPane.setRightComponent(comp);
* Returns the component below, or to the right of the divider.
* @return the <code>Component</code> displayed in that position
public Component getBottomComponent()
return splitPane.getBottomComponent();
* Updates the layout.
* If one child component is empty or an empty splitpane then remove the split
* and add this child to the content pane.
public void updateLayout()
if ((rightComponent != null)
&& (rightComponent instanceof AutoResizeSplitPane))
((AutoResizeSplitPane)rightComponent).updateLayout();
if ((leftComponent != null)
&& (leftComponent instanceof AutoResizeSplitPane))
((AutoResizeSplitPane)leftComponent).updateLayout();
if (isEmpty())
if (isSplitterVisible)
isSplitterVisible = false;
remove(splitPane);
update();
else if ((!isEmpty(leftComponent)) && (!isEmpty(rightComponent)))
//if (!isSplitterVisible)
removeAll();
isSplitterVisible = true;
splitPane.setLeftComponent(leftComponent);
splitPane.setRightComponent(rightComponent);
add(splitPane);
splitPane.revalidate();
splitPane.repaint();
update();
else if (isEmpty(leftComponent))
isSplitterVisible = false;
removeAll();
add(rightComponent);
update();
else if (isEmpty(rightComponent))
isSplitterVisible = false;
removeAll();
add(leftComponent);
update();
* Gets the preferred width.
int getPreferredWidth()
if (isEmpty())
return 0;
if (orientation == HORIZONTAL_SPLIT)
JComponent component;
if (isEmpty(rightComponent))
component = leftComponent;
else
component = rightComponent;
if (component instanceof AutoResizeSplitPane)
AutoResizeSplitPane pane = (AutoResizeSplitPane)component;
return pane.getPreferredWidth();
else
return component.getPreferredSize().width;
else
int w1 = 0;
int w2 = 0;
JComponent component;
if (isEmpty(rightComponent))
component = leftComponent;
if (component instanceof AutoResizeSplitPane)
AutoResizeSplitPane pane = (AutoResizeSplitPane)component;
w1 = pane.getPreferredWidth();
else
w1 = component.getPreferredSize().width;
else
component = rightComponent;
if (component instanceof AutoResizeSplitPane)
AutoResizeSplitPane pane = (AutoResizeSplitPane)component;
w2 = pane.getPreferredWidth();
else
w2 = component.getPreferredSize().width;
if (w1 == 0)
return w2;
else if (w2 == 0)
return w1;
else
return w1 + w2 + 7;
* Updates the split pane.
private final void update()
splitPane.doLayout();
if (orientation == VERTICAL_SPLIT)
splitPane.setDividerLocation(getPreferredWidth());
revalidate();
repaint();
* Gets if this component is empty or not.
* @return The component state.
public boolean isEmpty()
return (isEmpty(leftComponent) && isEmpty(rightComponent));
* Gets if a component is empty or not.
* @param component The component to check.
* @return If the component is empty or not.
private final boolean isEmpty(JComponent component)
if (component == null)
return true;
else if ((component instanceof AutoResizeSplitPane)
&& (((AutoResizeSplitPane)component).isEmpty()))
return true;
else
return false;
and here is a very usefull ui for nested auto resize split panes
import javax.swing.plaf.basic.BasicSplitPaneUI;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.JComponent;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.JSplitPane;
import javax.swing.border.Border;
* This class represents a border less split pane ui nedd to enhance the look of
* nested AutoResizeSplitPanes.
* @author Taoufik Romdhane
* @version 1.0
public class BorderLessSplitPaneUI extends BasicSplitPaneUI
* Creates a new BorderLessSplitPaneUI instance.
* @param component The component to install the ui for.
* @return The border less split pane ui.
public static ComponentUI createUI(JComponent component)
return new BorderLessSplitPaneUI();
* Installs the UI defaults.
protected void installDefaults()
//LookAndFeel.installBorder(splitPane, "SplitPane.border");
if (divider == null) divider = createDefaultDivider();
divider.setBasicSplitPaneUI(this);
Border b = divider.getBorder();
if (b == null || !(b instanceof UIResource))
divider.setBorder(UIManager.getBorder("SplitPaneDivider.border"));
setOrientation(splitPane.getOrientation());
// This plus 2 here is to provide backwards consistancy. Previously,
// the old size did not include the 2 pixel border around the divider,
// it now does.
splitPane.setDividerSize(((Integer) (UIManager.get(
"SplitPane.dividerSize"))).intValue());
divider.setDividerSize(splitPane.getDividerSize());
dividerSize = divider.getDividerSize();
splitPane.add(divider, JSplitPane.DIVIDER);
setContinuousLayout(splitPane.isContinuousLayout());
resetLayoutManager();
/* Install the nonContinuousLayoutDivider here to avoid having to
add/remove everything later. */
if (nonContinuousLayoutDivider == null)
setNonContinuousLayoutDivider(
createDefaultNonContinuousLayoutDivider(),
true);
else
setNonContinuousLayoutDivider(nonContinuousLayoutDivider, true);
* Uninstalls the UI defaults.
protected void uninstallDefaults()
if (splitPane.getLayout() == layoutManager)
splitPane.setLayout(null);
if (nonContinuousLayoutDivider != null)
splitPane.remove(nonContinuousLayoutDivider);
LookAndFeel.uninstallBorder(splitPane);
Border b = divider.getBorder();
if (b instanceof UIResource)
divider.setBorder(null);
splitPane.remove(divider);
divider.setBasicSplitPaneUI(null);
layoutManager = null;
divider = null;
nonContinuousLayoutDivider = null;
setNonContinuousLayoutDivider(null);
I encountred the same problem as you.
Plz contact me if there still be some pbs.
Good luck
Taoufik

Similar Messages

  • How can set up exchange account in outlook 2011 manually?

    I can't set up exchange account in outlook 2011 automatically. who can help me out?
    and how can know whether the account has been added successfully?

    If you can't add it automatically, you probably need some help from your company's helpdesk.  It would be best to contact them because they may have some settings that are specific to their environment.

  • How to set web job like a ssis which can take xmil file from azure storage to up date azure sql

    Hi,
    I have xml files under azure storage, i would like to set up web job which should be scheduled and
    load xml to update/insert/delete azure database.
    I have done SSIS locally and but cant use in azure.
    According to several advices and forum pages,I need to create azure web job.
    Please advice link or advice.
    Thanks.
    Superman

    Hi,
    To get started with Azure webjobs you could refer the following link:
    http://azure.microsoft.com/en-in/documentation/articles/websites-dotnet-webjobs-sdk-get-started/
    The article shows how to create a multi-tier ASP.NET MVC application that uses the WebJobs SDK to work with Azure blobs in an Azure Website.
    Meanwhile, we will research regarding your specific requirement and revert with our finds.
    Regards,
    Malar

  • How to set default folder view in Outlook PDF Portfolio?

    I'm using Acrobat 9.0 within MS Outlook 2007 to create a portfolio of a folder with subfolders. I would like the initial portfolio view to mimic a typical Outlook view with folder list and reading preview pane. I can create said view in the PDF file by splitting the window vertically and clicking my way to the desired folder level. But I cannot, for the life of me, figure out how to save those choices as a default under Portfolio Properties or elsewhere.  Can anyone offer advice?  Thanks.

    Can no one help me?  No one at all?

  • How to set video function like a default function when slip "camera" at lock screen ?

    Hi all.
    At lock ccreen:
    - We need to take the picture we turn on screen - slip "camera fuction" at the right bottom and take a shoot.
    - We need to record a video we turn on the screen - slip "camera fuction" at the right bottom and horizontal sliding to "video" function and take a record.
    With "video" fuction, after you record the video, you turn off the screen in one or tow minute, you need to record another video, you turn on the screen and slip camera function, but now it is not in "video function, it come back to "picture" function.
    It is very inconvenient for who need record some video.
    Now what i need:
    How to i can to setup up "video" fuction is a default function ?

    Nevermind I found why this was occuring. Under the same menu, there's an option called "Auto Aspect Ratio" I simply changed it to "off" and it solved the problem.
    Thank you.

  • Nouveau driver on Xorg how to set screen borders/margins ?

    Hi I'm using the nouveau driver on a TV screen at the resolution of 640x240, the problem is that the TV screen is an old screen of an arcade cabinet and some of the Xorg screen is out of the actual TV frame.
    There's a way to center the image from Xorg ?
    I'm looking for a solution but i didn't find yet.
    Thank you.

    I've messed out with the Modeline with no results and now i guess that my problem is a bit different... Advmame and sdlmame appear at center perfectly, wahcade too.
    I got an overscan problem only with xterm and xmame that appear cut out on the left. So I'm guessing is a problem of "Xorg related applications" ?
    There's a way to fix that ? I use the geometry option for xterm so i can put the console to the center of the screen... but this is more like a workaround than a stable solution, i would like to find a base solution for every Xorg related application and not using geometry for every Xorg app.
    Anyway if I'll find out what can i do and I'll post my workaround when i come up with something stable.
    [EDIT]
    I've find out what was the problem with xmame.
    I've changed the value of two configuration variables from 0 to 1:
    video-mode              1  # stands for: 1 Fullscreen DGA (hotkey left-alt + home)
    fullscreen              1 # xmame to fullscreen
    Last edited by marcs (2011-06-30 22:55:25)

  • How to set a Excel-like column-Filtering in the Table Header using swings

    I am currently working on the Database applications.Where i need to do column filter in the header field of the jTable, (i.e i need to keep a button in the Column header and when i click the button, it should pop-up a jList which has a unique values of the entire column. when i select that value it will show corresponding rows in the jTable). Can anyone pls help me....
    Thanks
    Karthik

    You can [get the table column header|http://java.sun.com/javase/6/docs/api/javax/swing/JTable.html#getTableHeader()] and add a mouse listener to it which waits for a popup menu trigger to display a popup menu.
    In that popup menu, you can display a list which contains the unique values of the column which was clicked on. Once a value is
    selected, you can filter the rows using that value.

  • How to set organizer mail id in meeting request  using CL_APPOINTMENT class

    Hi,
    I have two questions here.
    1. How to set the organizer mail id using the method of CL_APPOINTMENT class? I have used the method   SET_ORGANIZER of class CL_APPOINTMENT by passing my SAP user name 'GCM' but when i received the appointment within outlook, i am able see my server mail id like 'Madhu G C <[email protected]>' instead of my outlook mail id '[email protected]'.
    2. How to set reoccursive meeting request in Outlook using cl_appoinment?Example: i have a training on alternative days say on 01-mar, 03-Mar, 05-mar. When i book the course, i should get these alternative days in outlook in a single meeting request?
    Best Regards,
    Madhu

    Please post the question in correct forum. This forum is for webdynpro abap.
    Regards
    Srinivas

  • How to set priority (like outlook eamil) with ABAP, CL_BCS?

    Hi,
    I tried to set_priority function in CL_BCS, and it doesn't work as I expected. I'd like it to be the same behavior as the email in outlook, which can see as 'High Priority'. How can I get the effect with ABAP?
    In addition, is it possible to set a reminder (same as outlook email) for email in ABAP?
    Thanks,
    Miao

    Thanks Keshav.
    However, it doesn't work.
    send->set_priority( i_priority = '1' ).  "1-->high priority.
    I Googled it and find the following "solution".
    Set the importance of the document, like the following:
    l_document->set_importance( i_importance = '1' ).
    call method l_send_request->set_document( l_document ).
    The email will become high importance, because of the document is high importance.
    I don't know why CL_BCS works like the strange behavior?
    Best regards,
    Miao

  • "I would like to know how to set the default view for the columns. Somewhere I read it could be done in by music icon under Library.  Can't find it.  Thanks

    "I would like to know how to set the default view for the columns that are shown in iTunes. Every time I open it, I have to either go to the options, or right-click to get the pop-up options, and delete "rating" and add "composer." I'd really like to just do it once and be done with it."  Somewhere I read you could do this by clicking on the Music icon under LIBRARY then arramge the columns.  Trouble is, I can't find a Musi Folder or icon in my user library.
    Any help would be appreiated.  OSX 10.9.2  iTunes version 11.1.5  Thanks!!! CW!

    From the iTunes menu bar try View>Show View Options.  Make sure what you want to see is checked and what you don't is unchecked.  You can do this (may need to do this) for any playlists, your main Library, etc.
    Good luck
    srb

  • Does anyone know how to set alerts in the iCloud calendar of Outlook 2010 for PC?

    Does anyone know how to set alerts in the iCloud calendar on Microsoft Outlook 2010 for a PC?  Outlook gives me a warning message and does not allow me to save alerts for calendar events created in iCloud calendar.  It will allow me to save events in the non-iCloud calendars.

    Ignore what office says, when the warning comes up saying that the reminder will not work click on yes,
    I just tested it and i had the reminder on my ihpone in outlook and also as i had the calendar open in safari it popped up on there too ( I wasn't aware it did that)

  • TS3999 when I click on my iCloud panel, Calendars, I get an error message that says, Setup can't continue because Outlook isn't configured t have a default profile.  Check you Outlook settings and try again."  How do I set up these settings in Outlook 200

    when I click on my iCloud panel, Calendars, I get an error message that says, Setup can't continue because Outlook isn't configured t have a default profile.  Check you Outlook settings and try again."  How do I set up these settings in Outlook 2007

    Here are two threads you may want to review. I'm sure there are others. Good luck!
    https://discussions.apple.com/thread/3427840?start=0&tstart=0
    http://www.slipstick.com/outlook/icloud-outlook-problems-syncing-calendar/

  • How to set "like" field of the query in statements

    Hi,
    Im trying to set the "like" field of the statement.but it is not executing as expected.Could anybody please tell me,"how to set the like field in statements.
    Here is my code.
    PreparedStatement psum=con.prepareStatement("select count(bill_amount) from master where bill_date like ? and whos_bu=?");
    String myStr=month+"/??/"+year;
    psum.setString(1,myStr);
    psum.setString(2,employeeTray[1]);
    ResultSet rs=psum.executeQuery();

    Tnx a lot vidyut .using % is working.
    Could you plz tell me why the previous one using question mark is not
    working. using quesion mark is correct as per the query syntax.and also i tried with asterisk,it is also not working.
    ps:have some duke dollars.

  • In the os5, the alphabet in the right of contact is abcd, but in OS7 is A.D.G, how to set it like OS5

    In the os5, the alphabet in the right of contact is abcd, but in OS7 is A.D.G, how to set it like OS5

    You can't. That's just the way it is in iOS 7. Still performs the same task.

  • How to set images to your contacts to see their picture when there calling? Like their facebook picture.

    How to set images to your contacts to see thier picture when someone is calling? Like for instance facebook picture.(on the iPHONE 4s)

    You can manually add a photo to each contact on your iPhone - from an existing photo of the contact on your iPhone or capture a photo of the contact when together. Or add a photo for each contact in the address book app on your computer that is supported for syncing contacts with the iPhone followed by a sync.
    For FaceBook check this link, which I found with a Google search.
    http://www.iphonestuffs4u.com/how-to-sync-facebook-contacts-to-iphone/

Maybe you are looking for

  • Bug in CS3! When I tilt-crop a picture, the result is a distorted picture, why is that!?

    Bug in CS3! When I tilt-crop a picture, the result is a distorted picture, why is that!? The pictuer gets squezed togeher and faces look markably thinner.

  • Books Always Quit When Story Is Restarted.  Help, THUMBS ACHE!

    My audio books, when played and stopped for a while, will always only begin playing for about three minutes (after the stopping point) and then the file quits and defaults to the starting point. This is a major pain if I am halfway through a six hour

  • Ragged Hierarchy

    Can Oracle OLAP (9.2 or higher) handle a ragged hierarchy? eg: custom ownership chart **\C100\ **\C100\C101\ **\C100\C101\102\ **\C100\C101\103\ **\C100\C101\103\104 **\C100\C101\103\104\105\106\107 **\C200\C201 **\C300\C301 **\C300\C301\C302 In othe

  • VDA4905

    I have SOA 11g (BPEL, B2B and WLS) and Oracle EBiz Suite 11.5.10.2. I plan on using B2B to get the POs from my trading partner. My trading partner used VDA 4905 for the data interchange. I am trying to create the ecs file using B2B Document Editor. B

  • Best Quality Settings for a 24pa 16:9 Video

    Need DVDSP setting for best quality 10 minute DVD shot with canon xl2 24pa in true 16:9. Exporting from FCP to compressor. Cand seem to get DVDSP to recognize 24p. Any help will be appreciated.