Results 1 to 4 of 4
- 03-11-2011, 11:22 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Scrollbar to mainframe want imeediate response
i am creating a net beans project...
i wants to set scrollbar to main frame..
creating an instance and giving that instance to main frame is ok but i am not getting with that.
can any one help me that how to set scrollbar for mainframe in netbeans project?
another one is how to close a particular inner frame when we click a button on that frame....
thanks in advance
manoj
-
You're not giving us much information that will allow us to help you, such as your critical code. Have you gone through the scrollbar tutorials in the Swing tutorials? If not, I suggest that you start there. If you're still stuck, then show us your code and give us a lot more information on your problem, and then perhaps we can help.
Oh, also, it's not looked kindly here when folks demand an "immediate response", and you would do well to delete that line from your topic heading. It suggests that the poster is pushy and feels that his post is more important than anyone else's. Sorry to burst your bubble, but, it's not.
Best of luck.Last edited by Fubarable; 03-11-2011 at 11:35 AM.
- 03-11-2011, 12:05 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Scrollbar for Frame
is the constructor(NewProjectView) and component box(showAboutBox()) for my project which is automatically generated by netbeans...Java Code:public NewProjectView(SingleFrameApplication app) { super(app); initComponents(); // status bar initialization - message timeout, idle icon and busy animation, etc ResourceMap resourceMap = getResourceMap(); int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout"); messageTimer = new Timer(messageTimeout, new ActionListener() { public void actionPerformed(ActionEvent e) { statusMessageLabel.setText(""); } }); messageTimer.setRepeats(false); int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate"); for (int i = 0; i < busyIcons.length; i++) { busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]"); } busyIconTimer = new Timer(busyAnimationRate, new ActionListener() { public void actionPerformed(ActionEvent e) { busyIconIndex = (busyIconIndex + 1) % busyIcons.length; statusAnimationLabel.setIcon(busyIcons[busyIconIndex]); } }); idleIcon = resourceMap.getIcon("StatusBar.idleIcon"); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); // connecting action tasks to status bar via TaskMonitor TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext()); taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { String propertyName = evt.getPropertyName(); if ("started".equals(propertyName)) { if (!busyIconTimer.isRunning()) { statusAnimationLabel.setIcon(busyIcons[0]); busyIconIndex = 0; busyIconTimer.start(); } progressBar.setVisible(true); progressBar.setIndeterminate(true); } else if ("done".equals(propertyName)) { busyIconTimer.stop(); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); progressBar.setValue(0); } else if ("message".equals(propertyName)) { String text = (String)(evt.getNewValue()); statusMessageLabel.setText((text == null) ? "" : text); messageTimer.restart(); } else if ("progress".equals(propertyName)) { int value = (Integer)(evt.getNewValue()); progressBar.setVisible(true); progressBar.setIndeterminate(false); progressBar.setValue(value); } } }); } public void showAboutBox() { if (aboutBox == null) { JFrame mainFrame = NewProjectApp.getApplication().getMainFrame(); aboutBox = new NewProjectAboutBox(mainFrame); aboutBox.setLocationRelativeTo(mainFrame); } NewProjectApp.getApplication().show(aboutBox);
i am writing as
JScrollPane pain=new JScrollPane(jPanel5,JScrollPane.HORIZONTAL_SCROLLB AR_ALWAYS,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
and i wants to add it to mainframe
as """mainframe.add(pain);"""
but i am not getting how can i get it help me please....Last edited by Fubarable; 03-11-2011 at 01:14 PM. Reason: Moderator Edit: Code tags added
-
Often the key to adding a component to a container is to know which layout manager(s) to use. If you want to alter the components of a container in code and not in the NetBeans drag-and-drop designer, then you're going to want the component to use a layout other than the NetBeans default GroupLayout. Check out the tutorial on layout managers to learn more about this: Laying Out Components Within a Container
Similar Threads
-
Java for mainframe professionals
By tomehta in forum New To JavaReplies: 6Last Post: 06-09-2010, 02:07 PM -
ScrollBar in a JList
By lupo in forum AWT / SwingReplies: 2Last Post: 05-20-2010, 10:42 PM -
Looking for Java, Mainframe and QA Leads
By ITrecruiter in forum Jobs WantedReplies: 0Last Post: 04-20-2010, 06:53 AM -
scrollbar issue
By kumar_gemi in forum NetBeansReplies: 1Last Post: 05-03-2009, 10:23 PM -
Calling mainframe IMS program from Java
By babu95 in forum New To JavaReplies: 2Last Post: 12-21-2007, 01:08 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks