Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2007, 09:45 AM
Member
 
Join Date: Jul 2007
Posts: 5
praveenrn is on a distinguished road
need restore Look and Feel of application back to1.3 when jre is updated to jdk 1.5
Hi,

I have problem upgrading my apllication(swing) from jdk 1.3 to jdk 1.6, But this effects UILook and Feel.

Ineed a solution how i can get restore the Look and Feel back to that of 1.4 version.


Many Thanks Advance......

Praveen.

Last edited by praveenrn : 08-11-2007 at 07:29 AM. Reason: came to know actual problem is from 1.3 to 1.4 regarding what i asked
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 09:07 PM
Member
 
Join Date: Jul 2007
Posts: 43
leonard is on a distinguished road
Search how change the look and feel and set it in "metal".
I think that jdk 1.3 had it
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-26-2007, 09:20 AM
Member
 
Join Date: Jul 2007
Posts: 5
praveenrn is on a distinguished road
need custom implemetation for Look And Feel to get back the 1.3 in 1.5
Hi,

Could you please provide me sample code will help.

I think you are asking me to add my custom Metal theme and set usin UIManager.


Thanks.

Last edited by praveenrn : 03-07-2008 at 09:10 AM.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-26-2007, 08:05 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Hi Praveen,

Yes, you will set it with UIManager but Metal Look and Feel was the standard look and feel of Java. I heard that Sun will change or already changed default look and feel for Java to make it more competitive. So if thsi is the reason, first you should know which look ad feel you were using and then set the LF to it from your Java code explicitly.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-27-2007, 03:53 PM
Member
 
Join Date: Jul 2007
Posts: 5
praveenrn is on a distinguished road
need solution to get rid of problem caused due to migration from jdk 1.3 to 1.5/1.6
Hi,

Thanks Iam able to get back my Look and Feel almost by using System properties

System.setProperty("swing.noxp","true");
System.setProperty("swing.useSystemFontSettings"," false");


But there is also one more problem left.

I said already that iam migrating application from 1.3 to 1.6/1.5.
I have one class using JScrollBar throwing NullPointer Exception which is working very much fine in jdk 1.3 vesion.

but in the following code iam able to observe that incrButton is assigned with an JButton in version 1.3 But in 1.5 it is assigned with null value. The problem is ihave code that is written Listener on this button. Even though iam able to get the Button in scrollbar. and then i commeted or assigned null and compiled in 1.3 version the buttons are not displayed,what i mean to say is incrButton variable in BasicScrollBarUI is reffering the Button that is visible in scrollbar. But in 1.5 version incrButton is not assigned with JButton and still the Button as able to see in ScrollBar.

An Code is like that Listener has been added to that button because of this NullPointer Exception is coming.

I would like to ask how can i write listener on ArrowButtons in Basic ScrollBarUI. in 1.5

How to get rid of it.

what needs to to be updated for this to be worked in new version


Thanks in Advance....

-----------------------------------------------------------------------
ERROR is



java.lang.NullPointerException
at pms.ExtGridControl$3.installDefaults(ExtGridContro l.java:38)
at javax.swing.plaf.basic.BasicScrollBarUI.installUI( Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JScrollBar.setUI(Unknown Source)
at pms.ExtGridControl$2.updateUI(ExtGridControl.java: 45)
at javax.swing.JScrollBar.<init>(Unknown Source)
at javax.swing.JScrollBar.<init>(Unknown Source)
at javax.swing.JScrollBar.<init>(Unknown Source)
at pms.ExtGridControl$2.<init>(ExtGridControl.java:33 )
at pms.ExtGridControl.createVerticalScrollBar(ExtGrid Control.java:33)
at javax.swing.JScrollPane.<init>(Unknown Source)
at javax.swing.JScrollPane.<init>(Unknown Source)
at com.borland.jbcl.view.GridView.<init>(GridView.jav a:47)
at com.borland.jbcl.control.GridControl.<init>(GridCo ntrol.java:44)

--------------------------------------------------------------------------


Code


import com.borland.jbcl.control.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.basic.*;

/**
* extends GridControl:
* inserts a new row if the user clicks into the empty area or scrolls down
*/
public class ExtGridControl extends GridControl{
public ExtGridControl() {

super();
addMouseListener(new MouseAdapter() {

public void mouseReleased(MouseEvent e) {
if (null ==hitTest(e.getPoint().x,e.getPoint().y))
addRow();
}
});
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
public JScrollBar createVerticalScrollBar() {
JScrollBar scrollBar = new JScrollBar() {
public void updateUI() {
BasicScrollBarUI myUI = new BasicScrollBarUI (){
protected void installDefaults() {

super.installDefaults();
incrButton.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(MouseEvent e) {
checkAddRow();
}
});
}
};
setUI(myUI);

}
};
return scrollBar;
}

void checkAddRow() {
try {
if (getRowCount() == getDataSet().getRowCount()) {
SwingUtilities.invokeLater( new Runnable(){
public void run() {
addRow();
}
});
}
}
catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(this,ex.getMessage() );
}

}

private void jbInit() throws Exception {
this.addKeyListener(new java.awt.event.KeyAdapter() {

public void keyReleased(KeyEvent e) {
this_keyReleased(e);
}
});
}

void this_keyReleased(KeyEvent e) {
if (e.getKeyCode()== e.VK_ENTER || e.getKeyCode() == e.VK_DOWN)
addRow();

}
}

Last edited by praveenrn : 08-03-2007 at 06:21 AM.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 08-10-2007, 05:21 PM
Member
 
Join Date: Jul 2007
Posts: 51
mary is on a distinguished road
I'm trying to test your code, but I do not have com.borland.jbcl.control package
can you send it to me?

Last edited by mary : 08-10-2007 at 05:23 PM.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 08-11-2007, 07:22 AM
Member
 
Join Date: Jul 2007
Posts: 5
praveenrn is on a distinguished road
thanks
Hi iam not able to upload as it exceeds the limit.

And Thanks for your offer to help me.

I have got referencce to the Arrow Buttons from scrollBar.getComponents()[i] method.

So problem is solved.

iam pasting the code for you..


Code:
import com.borland.jbcl.control.*; import java.awt.Component; import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.basic.*; /** * extends GridControl: * inserts a new row if the user clicks into the empty area or scrolls down */ public class ExtControl extends GridControl{ public ExtControl() { super(); addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent e) { if (null ==hitTest(e.getPoint().x,e.getPoint().y)) addRow(); } }); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public JScrollBar createVerticalScrollBar() { JScrollBar scrollBar = new JScrollBar() { public void updateUI() { BasicScrollBarUI myUI = new BasicScrollBarUI (){ protected void installDefaults() { super.installDefaults(); if(incrButton!=null) incrButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseReleased(MouseEvent e) { checkAddRow(); } }); } }; setUI(myUI); } }; for(int i=0;i<scrollBar.getComponents().length;i++){ scrollBar.getComponents()[i].addMouseListener(new MouseListener(){ public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub checkAddRow(); } public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub }}); } return scrollBar; } void checkAddRow() { try { if (getRowCount() == getDataSet().getRowCount()) { SwingUtilities.invokeLater( new Runnable(){ public void run() { addRow(); } }); } } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(this,ex.getMessage()); } } private void jbInit() throws Exception { this.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(KeyEvent e) { this_keyReleased(e); } }); } void this_keyReleased(KeyEvent e) { if (e.getKeyCode()== e.VK_ENTER || e.getKeyCode() == e.VK_DOWN) addRow(); } }

Last edited by JavaBean : 08-11-2007 at 10:44 PM.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 08-11-2007, 10:44 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
praveenrn, please use [code] tag around your codes next time.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing - Look and feel Java Tip Java Tips 0 03-11-2008 11:53 PM
Need help with my project : Back up application riz618 New To Java 1 01-27-2008 08:41 AM
RCP Custom Look and Feel JavaForums Java Blogs 0 01-02-2008 07:12 PM
Look and Feel arun_kumar AWT / Swing 1 11-17-2007 07:21 PM
Running application in back fernando Advanced Java 1 08-01-2007 01:25 AM


All times are GMT +3. The time now is 11:58 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org