Problem with scroll tab layout in JtabbedPane
Pls. if anyone know this, help me
I have a problem, my scroll tab layout policy does not working when I set it to UI.
import javax.swing.*;
import javax.swing.plaf.basic.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.plaf.*;
public class Components_Area extends JFrame{
JTabbedPane tab = new JTabbedPane(JTabbedPane.TOP,JTabbedPane.SCROLL_TAB_LAYOUT);
JLabel l[] = new JLabel[5];
public Components_Area() {
tab.setUI(new TestPlaf());
tab.addTab("Untitled",l[0]);
tab.addTab("Untitled",l[1]);
tab.addTab("Untitled",l[2]);
tab.addTab("Untitled",l[3]);
tab.addTab("Untitled",l[4]);
getContentPane().add(tab);
public static void main(String args []) {
Components_Area frame = new Components_Area();
frame.setSize(200,200);
frame.show();
static class TestPlaf extends BasicTabbedPaneUI {
protected LayoutManager createLayoutManager() {
return new TestPlafLayout();
protected Insets getTabInsets(int tabPlacement,int tabIndex) {
Insets defaultInsets = (Insets)super.getTabInsets(tabPlacement,tabIndex).clone();
defaultInsets.right += 50;
defaultInsets.top += 2;
return defaultInsets;
class TestPlafLayout extends TabbedPaneLayout {
//a list of our close buttons
java.util.ArrayList closeButtons = new java.util.ArrayList();
public void layoutContainer(Container parent) {
super.layoutContainer(parent);
//ensure that there are at least as many close buttons as tabs
while(tabPane.getTabCount() > closeButtons.size()) {
closeButtons.add(new CloseButton(closeButtons.size()));
tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
Rectangle rect = new Rectangle();
int i;
for(i = 0; i < tabPane.getTabCount();i++) {
rect = getTabBounds(i,rect);
JButton closeButton = (JButton)closeButtons.get(i);
//shift the close button 3 down from the top of the pane and 20 to the left
closeButton.setLocation(rect.x+rect.width-20,rect.y+4);
closeButton.setSize(15,15);
tabPane.add(closeButton);
for(;i < closeButtons.size();i++) {
//remove any extra close buttons
tabPane.remove((JButton)closeButtons.get(i));
// implement UIResource so that when we add this button to the
// tabbedpane, it doesn't try to make a tab for it!
class CloseButton extends JButton implements javax.swing.plaf.UIResource {
public CloseButton(int index) {
super(new CloseButtonAction(index));
setBorder( BorderFactory.createEmptyBorder() );
setToolTipText("Close this tab");
//remove the typical padding for the button
setMargin(new Insets(0,0,0,0));
addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
setBorder( BorderFactory.createLineBorder(Color.black, 1 ));
public void mouseExited(MouseEvent e) {
setBorder( BorderFactory.createEmptyBorder() );
class CloseButtonAction extends AbstractAction {
int index;
public CloseButtonAction(int index) {
super("x");
this.index = index;
public void actionPerformed(ActionEvent e) {
tabPane.remove(index);
} Message was edited by:
henyo
If someone knows this, help me!
Similar Messages
-
Problem in scroll tab layout policy
Hi everyone!!
I made a application using tabbedpanes. My problem is when i put
an "x" button for close in the tab title area the scroll tab layout policy
are not working, but if no button it's working.
I need a closable Jtabbedpane with scroll tab policy.
Pls anyone help me.
It's my big appreciationno i dont have the code,
i am just telling the idea....
create a image labels inspite of tabs create panels corresponding to it
add ur needs inside the panel and make it visible according to the tab clicked -
Siebel Sales Enterprise 8.0.0.8 - problem with Screen Tab Layout
Hello all !
I create [Manager] Resonsibility and check hide [Opportynities screen] in Screen Tab Layout for [Manager] Resonsibility for Siebel Sales Enterprise.
I added user Bob with [Manager] resonsibility.
But user Bob stiil see Opportunities Screen when log on.
User Bob has no other resonsibilities.
I cannot inactivate Opportynities screen because this screen used by other resonsibilities.
What is cause of with issue?
Best Regards
LevHello,
Did you delete the user preferences of this user prior to your test ?
I also assumed that the default view is not part of Opportunity screen when you log in.
Best Regards
EvtLogLvl -
PDF Portfolio Navigator with horizontal tab layout
Hello, Experts
I am trying to create a PDF Portfolios with horizontal tab layout structure;
several .NET libraries allowed me to create PDF files with thumbnail layout, but, in order to populate a horizontal tab
layout, it seems, I would need to create a custom PDF navigator and import it into PDF Portfolio prior to inserting PDF file components ?
preinstalled navigators look great, but I just need a simple horizontal tab view, where each tab only contains file's name and nothing else;
buy clicking on each tab - corresponding file would be activated in the viewer
is there any library of predesigned navigators that I can use ?
is there any way to extract navigator from one and import it into another PDF portfolio ?
would I need to use Flash or can this be done via .NET ?
Best Regards,
-Alextried to install Portfolio SDK
can't see the Navigator project wizard in Flex Builder ( 4.6 )
The plugins have been extracted to:
C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse\plugins
The NavigatorSupport folder has been extracted to:
C:\Program Files\Adobe\Adobe Flash Builder 4.6\eclipse and ( just in case ) to
C:\Program Files\Adobe\Adobe Flash Builder 4.6\ -
In the last few days, I've encountered a problem with scrolling with my up & down keys. The up & down keys seem to, now function as Home & End keys. MyPage Up & Page Down keys seem to do nothing. What is wrong?
Hit the '''F7''' key, you probably have Caret browsing turned on.
http://kb.mozillazine.org/Accessibility.browsewithcaret -
I have a problem with cross tab.
When I do grouping on date according to month and summarize the units I am getting the result as 58
while I do grouping without the croos tab generally in the details section I get the result to be 64.
I am not able to understand where is the problem.
Even when I write a query i get the answer as 64.Hi,
Summarizing with a Cross-tab and creating a summary of a group are one and the same; I mean, the summary results are always the same.
Could you check the summary operation in the crosstab, could you confirm if it is not count or something else?
Also, create a summary and place it on the Group Header/Footer. It should be same as the Crosstab results for the that particular group.
-Abhilash -
Parallax Scrolling: Problems with scroll wheel
Hi,I'm syue
I learn parallax effect from this video.
It helps me a lot ,but I have a problem with scroll wheel
Everything looks nice on my computer.
But when I make a test on different computers.It will show something like this...
https://docs.google.com/file/d/0B-eo1Bu6k3N-cEw2c3dyWEpfNDA/preview
I don't know how to explain the situation so I make this video.
I also chick my code and it shows me everything is fine.
I don't know how to solve this problem
Can you give me some advice?
Best regards. :-DI know many people who have 30 gig and no wheel problem. I have an 80 gig and no problem. Finding your warranty (or buying the extended warranty) would be useful.
Good luck.
Kid -
Problem with switching tabs in top level navigation for Roles
Hi,
I've created two tabs (based on two roles) in the portal top level navigation menu. When clicking the first one it opens as it should. Then when clicking on the second tab it will not open, instead the first tab open up again, it sort of switches back automatically.These two roles are basically consists of worksets and iviews(accessing to r/3).
Does anyone have any expericene with this type of problem?
please suggest me
Thanks
AravindaHi Aravinda
Please check this link
Re: Problem with switching tabs in top level navigation
Regards
Geogi -
Problems with scrolling and Mission Control
I have this problem:
When scrolling down any page, the letters will blur at the top of the screen and not the bottom.
When swiping acrross pages in the launchpad, it occasionaly freezes half way between the two.
When I swipe up with four fingers to access mission control, the screen becomes very sluggish. Swiping back down (or clicking a tab) is even worse, causing slow "laggy" animations.
And this the report from EtreCheck:
Hardware Information:
MacBook Pro (13-inch, Mid 2012)
MacBook Pro - model: MacBookPro9,2
1 2.5 GHz Intel Core i5 CPU: 2 cores
4 GB RAM
Video Information:
Intel HD Graphics 4000 - VRAM: 1024 MB
System Software:
OS X 10.9.2 (13C1021) - Uptime: 0 days 0:3:16
Disk Information:
APPLE HDD HTS545050A7E362 disk0 : (500.11 GB)
EFI (disk0s1) <not mounted>: 209.7 MB
Macintosh HD (disk0s2) / [Startup]: 499.25 GB (309.44 GB free)
HL-DT-ST DVDRW GS41N
USB Information:
Apple Inc. Apple Internal Keyboard / Trackpad
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM20702 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. FaceTime HD Camera (Built-in)
FireWire Information:
Thunderbolt Information:
Apple Inc. thunderbolt_bus
Configuration files:
/etc/hosts - Count: 1
Launch Daemons:
[loaded] com.adobe.fpsaud.plist Support
[loaded] com.microsoft.office.licensing.helper.plist Support
Launch Agents:
[not loaded] com.bose.soundtouch.plist Support
User Launch Agents:
[loaded] com.adobe.ARM.[...].plist Support
[loaded] com.google.keystone.agent.plist Support
[running] com.spotify.webhelper.plist Support
User Login Items:
iTunesHelper
Spotify
BitTorrent
Autodesk 360
Internet Plug-ins:
SharePointBrowserPlugin: Version: 14.0.0 Support
FlashPlayer-10.6: Version: 13.0.0.201 - SDK 10.6 Support
AdobePDFViewer: Version: 10.0.0 Support
Flash Player: Version: 13.0.0.201 - SDK 10.6 Support
QuickTime Plugin: Version: 7.7.3
Default Browser: Version: 537 - SDK 10.9
Audio Plug-ins:
BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
AirPlay: Version: 2.0 - SDK 10.9
AppleAVBAudio: Version: 203.2 - SDK 10.9
iSightAudio: Version: 7.7.3 - SDK 10.9
iTunes Plug-ins:
Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
3rd Party Preference Panes:
Flash Player Support
Time Machine:
Time Machine not configured!
Top Processes by CPU:
2% WindowServer
2% SoundTouch music server
0% fontd
0% BitTorrent
0% mds
Top Processes by Memory:
90 MB mds_stores
86 MB Safari
78 MB Spotify
57 MB Spotify Helper
49 MB ocspd
Virtual Memory Information:
1.83 GB Free RAM
1.44 GB Active RAM
190 MB Inactive RAM
558 MB Wired RAM
303 MB Page-ins
0 B Page-outsI have this problem:
When scrolling down any page, the letters will blur at the top of the screen and not the bottom.
When swiping acrross pages in the launchpad, it occasionaly freezes half way between the two.
When I swipe up with four fingers to access mission control, the screen becomes very sluggish. Swiping back down (or clicking a tab) is even worse, causing slow "laggy" animations.
And this the report from EtreCheck:
Hardware Information:
MacBook Pro (13-inch, Mid 2012)
MacBook Pro - model: MacBookPro9,2
1 2.5 GHz Intel Core i5 CPU: 2 cores
4 GB RAM
Video Information:
Intel HD Graphics 4000 - VRAM: 1024 MB
System Software:
OS X 10.9.2 (13C1021) - Uptime: 0 days 0:3:16
Disk Information:
APPLE HDD HTS545050A7E362 disk0 : (500.11 GB)
EFI (disk0s1) <not mounted>: 209.7 MB
Macintosh HD (disk0s2) / [Startup]: 499.25 GB (309.44 GB free)
HL-DT-ST DVDRW GS41N
USB Information:
Apple Inc. Apple Internal Keyboard / Trackpad
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM20702 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. FaceTime HD Camera (Built-in)
FireWire Information:
Thunderbolt Information:
Apple Inc. thunderbolt_bus
Configuration files:
/etc/hosts - Count: 1
Launch Daemons:
[loaded] com.adobe.fpsaud.plist Support
[loaded] com.microsoft.office.licensing.helper.plist Support
Launch Agents:
[not loaded] com.bose.soundtouch.plist Support
User Launch Agents:
[loaded] com.adobe.ARM.[...].plist Support
[loaded] com.google.keystone.agent.plist Support
[running] com.spotify.webhelper.plist Support
User Login Items:
iTunesHelper
Spotify
BitTorrent
Autodesk 360
Internet Plug-ins:
SharePointBrowserPlugin: Version: 14.0.0 Support
FlashPlayer-10.6: Version: 13.0.0.201 - SDK 10.6 Support
AdobePDFViewer: Version: 10.0.0 Support
Flash Player: Version: 13.0.0.201 - SDK 10.6 Support
QuickTime Plugin: Version: 7.7.3
Default Browser: Version: 537 - SDK 10.9
Audio Plug-ins:
BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
AirPlay: Version: 2.0 - SDK 10.9
AppleAVBAudio: Version: 203.2 - SDK 10.9
iSightAudio: Version: 7.7.3 - SDK 10.9
iTunes Plug-ins:
Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
3rd Party Preference Panes:
Flash Player Support
Time Machine:
Time Machine not configured!
Top Processes by CPU:
2% WindowServer
2% SoundTouch music server
0% fontd
0% BitTorrent
0% mds
Top Processes by Memory:
90 MB mds_stores
86 MB Safari
78 MB Spotify
57 MB Spotify Helper
49 MB ocspd
Virtual Memory Information:
1.83 GB Free RAM
1.44 GB Active RAM
190 MB Inactive RAM
558 MB Wired RAM
303 MB Page-ins
0 B Page-outs -
Problem with TabStrip Tabs visible
Hello Gurus,
I have Tabstrip in my application and in that tabstrip i have 3 tabs called tab1, tab2 ,tab3.
I have created above Tabstrip under
DC->WebdynproComponent>View-> in view i have created Transparent Container of layout type GridLayout -
> here i have created TabStrip with 3 Tabs like above mentioned names and i have created UI elements(Like labels and input fields) each Tab.
Once i deploy and run application, i am able to see only Tab1, remaing 2 Tabs are underlying with Tab1, i mean, unable to see all Tabs at a time, if i click on one Tab, remaining Tabs are underlying in that Tab.
Could you please reply me back, how can i acheive this?
Thanks
Venkat.Hi Venkat,
Check if the visible property of all the tabs within the tab strip is visible. Also, make sure thet in the tab strip properties you have selected the default tab to be visible in selectedTab property. Even if then it doesn't work, try increasing the overall width of the tabstrip.
Let me know, if you still have any problem.
Regards,
Tushar Sinha -
Problem with scrolling a panel containing an image
I am having a problem adding scrolling capabilities to a tabbed panel containing pages containing an image. In my program, I have a class called ImagePanel that extends JPanel and contains an image read from a file. In another class, I create a tabbed panel and add to it ImagePanels.
The problem I'm facing is that the pages added to my tabbed panel contain scroll bars, but these scroll bars are not scrollable (i.e. I cannot use the bars the scroll and see the missing parts of the image).
Any help on this manner is highly appreciated.
The code is shown below:
JTabbedPane m_pathwayTabbedPane = new JTabbedPane();
ImageIcon overviewImageIcon = IconLoader.readImageIcon(pathway.gif);
ImagePanel overviewPanel = new ImagePanel(overviewImageIcon.getImage());
JScrollPane graphcrollPane = new JScrollPane(overviewPanel,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
m_pathwayTabbedPane.addTab(StringManager.OVERVIEW, graphcrollPane);import java.awt.*;
import java.io.*;
import java.net.*;
import javax.imageio.ImageIO;
import javax.swing.*;
public class ScrollingImages
public static void main(String[] args)
String[] fileNames = {
"images/bclynx.jpg", "images/mtngoat.jpg", "images/redfox.jpg"
JPanel panel = new JPanel(new GridBagLayout());
panel.setBackground(Color.black);
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(5,5,5,5);
gbc.gridwidth = gbc.REMAINDER;
for(int j = 0; j < fileNames.length; j++)
panel.add(new ImageComponent(fileNames[j]), gbc);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new JScrollPane(panel));
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
class ImageComponent extends JPanel
Image image;
public ImageComponent(String fileName)
loadImage(fileName);
setBackground(Color.black);
protected void paintComponent(Graphics g)
super.paintComponent(g);
int w = getWidth();
int h = getHeight();
int imageWidth = image.getWidth(this);
int imageHeight = image.getHeight(this);
int x = (w - imageWidth)/2;
int y = (h - imageHeight)/2;
g.drawImage(image, x, y, this);
* For the JScrollPane which will inquire about our size
* which it needs to properly set its scrollbars.
public Dimension getPreferredSize()
return new Dimension(image.getWidth(this), image.getHeight(this));
private void loadImage(String fileName)
try
URL url = getClass().getResource(fileName);
image = ImageIO.read(url);
catch(MalformedURLException mue)
System.out.println(mue.getMessage());
catch(IOException ioe)
System.out.println(ioe.getMessage());
} -
Problem with Pullout Tab/Scrollable Frame
I've designed a pullout tab and in the Scrollable Frame Overlay I've specified "Horizontal" as the scroll direction. Now, with Desktop Preview everything looks fine. On the iPad however, the frame can be moved around in all kind of directions - up, down, left, right, even in circles (so to speak).
When I copied the frame to another empty page for test purposes, everything worked as planned with Desktop Preview and on the iPad. So then I added the rest of my content to that test page and voila, the problem resurfaced. I also have other pages with pullout tabs in the same folio that work just fine. I'm lost to what causes this behaviour in this one article.
Anyone had this before?
Thanks.My mistake, I meant the layers panel. Try renaming your graphic frames to samething unique.
-
Hi
I searched this forum for a solution for my problem with no luck...
I have the following setup:
____________________/ParentTab1\/ParentTab2\
Tab1_____________________________________When I click on a link on the page displayed by Tab1, it navigates to another page which has no attached tab, but has the property Standard tab Set set to the correct one (Tab1). I would like it to display exactly the same layout as above, but it displays this:
Tab1_____________________________________I.e., the parent tabs are missing (though the second level tab shows).
What should I change to make the parent tabs to appear?
Thanks
LuisDenes,
Thanks for the reply. The page template was "Application default", but I set it to "Two tabs" without result.
I moved the Tab1 tab to another parent tab and got the same result as well... Then moved it back to the original parent tab and all stayed the same.
Still can't make the parent tabs to display. I checked the tab definitions and all seems fine.
By the way, what is the relation between tabsets and parent tabs? I could not find a place to edit a tabset name/properties...
Thanks
Luis -
Problems with scroll bars in list view
Hello,
I am using Xcelsius 2008 (Build Number 12,2,166). I am still having trouble with scroll bars on my list view control. Other list views in my dashboard seem to be ok. It seems that this list view is not ignoring the blank cells in my excel file. I have gone through many things to correct this problem. I have added a new list view, I have copied other list views that work correctly but still no success. It seems that the "Ignore Blank Cells" property is not working correctly. Does anyone have a solution for this?
Much Thx!Hi Yusufel,
Please check the data whether the cells are really blank or having any space which could not be seen, etc.
With best wishes
BaaRaa. -
Problems with fluid grid layout live site only showing phone view in Chrome and Firefox Feb 2015
Hi all,
I have done a complex fluid grid layout using DW 2014 CC. The site has now gone live on the web masters server setup.
Up until now the layout of the site has been working fine and responding to screen size.
Early this morning in the USA the site stopped working. The layout for some users, not all, is only showing the phone view, and takes a long time to load.
This is happening in Chrome and Firefox, but IE is displaying the site properly.
So it looks like the CSS media queries are not working on all browsers.
I am using BC for the test site, and one user having this problem can see that version of the site OK.
I noticed that Chrome has done some updates recently Chrome Releases
Has anyone else come across this problem with Chrome and Firefox with their responsive layouts?
Thanks for any help given.Hi Ben,
Yes, thanks for this link. The Travel Health Website is one of ours, hosted on BC, and no reported problems so far. We also have another large BC website with ga code in it and users are not reporting problems with it. The Headless Way
However the problem website is hosted elsewhere on a different platform to BC. We have been developing it for three months now, and no problems so far until yesterday. The problem of the site taking ages to load, and timing out seems to be happening with about 10% of users in the USA. http://www.harrisonassessments.com/
The web developer found a user in NZ who was experiencing the slow display problem. They looked at the site with Chrome, Firefox and IE. The site would only display on IE. When the developer removed the google analytics code, the site displayed fine on all browsers for the NZ user. We are waiting for users in the USA to wake up and test the site.
So the problem definitely is related to the ga code and the responsive layout that was done by me in DW2014.1 fluid grid layout. So the related problem of DW2014.1 not being able to load htm files with ga code in them looks to be a good clue to what is going on here.
As there was a bug report for DW2014.1 and google analytics code made in the other thread, I would be interested to know if that was ever solved.
It is interesting that you are pushing Bootstrap and Foundation on me. (Big square websites here I come! lol)
I wonder if DW is going to persist with fluid grid layout then? I certainly hope so, as I have spent 12 months blood sweat and tears learning how to do it in DW.
Maybe you are looking for
-
When trying to access the iCloud, I am getting a message requiring I sign in. This I attempt to do. However, I then get the message "Cannot Sign In", and "This Apple ID is valid, but is not an iCloud account". Somewhat perplexed & confused, I then se
-
How to make Mutt list messages in a descending order
Hey. How do I make mutt list my messages with the newest message at the top, like in the web interface of Gmail? It is called descending listing starting with the newest message, I suppose.
-
I have lost all my ringtones, and music...HELP ME!
I recently bought 4 songs, and 1 ringtone from the iTunes Store on my iPhone 3GS. I went to plug my iPhone in my computer so I can transfer my music from my iPhone to my computer. When none of my music files transfered I got a little worried so I loo
-
We are currently using FDM to upload actuals data into and HFM app and budget data to a Planning app from one template through the multiload functionality. Is there a way to avoid having to import the same template twice and still send it to both app
-
after fresh inst of oel 5.3, as required update is in process, while executing the statement rpm -Uvh compat-glibc-2.3.4-2.26*, im getting the following error, any assistance shall be highlly appreciated.. warning: compat-glibc-2.3.4-2.26.i386.rpm: H