sreenath reddy

Ranch Hand
+ Follow
since Sep 21, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sreenath reddy

Hi

I have a scenario where i build a panel using GridBagLayout . Later i remove certain components and wanted the components to be realigned so that empty gaps are vanished.

I tried using .validate() ,.updateUI() but its not working as expected.

Am i doing something wrong or is there any other altenate way of doing this ?

Here is my Code

public class Test
{

/**
* @param args
*/
public static void main (String[] args)
{
JDialog dlg = new JDialog();

dlg.setContentPane(new TestPanel());
dlg.setSize(400,400);
dlg.show();
}

}

class TestPanel extends JPanel
{
public TestPanel()
{
init();
}

void init()
{
setLayout(new GridBagLayout());
GridBagConstraints cons = new GridBagConstraints();
cons.weightx = 1;
cons.weighty = 1;
//cons.gridx = 0;
cons.gridy = 0;
cons.fill = GridBagConstraints.BOTH;

add(new JLabel("Test"), cons);
add(new JLabel("Test1"), cons);
//cons.gridx = 0;
cons.gridy = 1;
add(new JLabel("Test"), cons);
add(new JLabel("Test1"), cons);
cons.gridy = 2;
cons.weightx = 2;
JButton test = new JButton("Click to Repaint");
add(test,cons);
test.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
TestPanel.this.remove(1);
//TestPanel.this.invalidate();
TestPanel.this.validate();
TestPanel.this.updateUI();
}
});

}

}
17 years ago
Hi

I am using a TableCellEditor for my JTable , where i am setting the backgroung color of the component . My OS is windows XP and it works fine if i am using the Windows Classic Style theme .

But if i shift to Windows XP themes (default windows provides) , background color is not set properly.

Here is peice of TableCellEditor

public Component getTableCellEditorComponent (JTable table,
Object value, boolean isSelected, int row, int column)
{
final JComponent comp = (JComponent) super
.getTableCellEditorComponent(table, value, isSelected, row,
column);
comp.setBackground(new Color(250, 250, 150));
return comp;
}

Any help on this would be appreciated .

thanks
Sreenath
18 years ago
We are using java 1.4 and Jboss is running on Linux dual core system . We recently got a core dump , with out not much load on memory

Can you let us know what could be the reason for this ?

I see that a signal 10 is being raised showing that its generated in case of hardware fault

Here is the log


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 10 occurred at PC=0xFF023EB0
Function=[Unknown. Nearest: Java_java_util_zip_Inflater_init+0x440]
Library=/opt/j2se-1.4.2/jre/lib/sparc/libzip.so

Current Java thread:
at java.util.zip.Inflater.reset(Native Method)
at java.util.zip.Inflater.reset(Inflater.java:279)
- locked <0x8dee8d98> (a java.util.zip.Inflater)
at java.util.zip.ZipFile.getInflater(ZipFile.java:261)
- locked <0x8dee85c8> (a java.util.Vector)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:209)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:184)
at java.util.jar.JarFile.getInputStream(JarFile.java:359)
- locked <0x8dee84f0> (a java.util.jar.JarFile)
at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:616)
at sun.misc.Resource.getBytes(Resource.java:57)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:518)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
- locked <0x8de88bc0> (a org.jboss.mx.loading.UnifiedClassLoader3)
at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:298)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:118)
18 years ago
Hi

I have a requirement, where if a message arrives from a server, the IE window(which may in the task bar) should start flashing - indicating to the user that there has been some change. Does anybody have an idea how we can accomplish flashing of an IE or a browser window in the taskbar of a user?

I am using AJAX to get notified about the changes , but how can i show it to the user ? I thought of alert , but this won't work if the user has minimized the browser in which my application is working ..

Any help would be appreciated in this regard

Sreenath
Hi Deepa

I don't think there is a way to do that with out the text having some empty spaces . Rather you can use a div for the table so that the data will always stick to the grid with a scroll coming for that section.

Let me know if you get that done in a better way .

Regards
Sreenath
Hi Thomson

See you should use the URLConnection to connect to your server and get the response. But you must be sure of how to communicate to the Crystal reports . As far as i know its not HTTP thus there is no ? of using HTTPURLConnection.

Its just the same as connecting from Simple java program , but here you can get the outputStream from crystal reports in to the ServletOutputStream of the response.

hope you got what i said

Regards
Sreenath
18 years ago
Hi

I am curious to know why SessionBean is extending EnterpriseBean interface(Which inturn extends Serializable) thus being a Marker interface.

Instead the SessionBean could have directly extended the Serializable interface .. Why is this done ??

I would appreciate if someone could throw light on this design aspect ??

Regards
Sreenath
Thanks Travis .. Is there anything like this for Textbox as well ??
18 years ago
Hi

I have a scenario in which there are multiple checkboxes in the same page belonging to one logical entity(Say Hobbies with multiple options given to choose in the form of Checkbox Group).

Now in my ActionForm(Bean)i am using one get and set method with String[] as dataType.

So when the user selects multiple hobbies and clicks Submit, values gets filled properly . But during the modification scenario (like i set the hobbies to the form bean), the appropriate hobbies are not getting selected automatically though i used html:checkbox tag.

Is it that checkbox tag is not handling for Array of Values ??
18 years ago
Hi

I have a scenario in which there are multiple checkboxes in the same page belonging to one logical entity(Say Hobbies with multiple options given to choose in the form of Checkbox Group).

Now in my ActionForm(Bean)i am using one get and set method with String[] as dataType.

So when the user selects multiple hobbies and clicks Submit, values gets filled properly . But during the modification scenario (like i set the hobbies to the form bean), the appropriate hobbies are not getting selected automatically though i used html:checkbox tag.

Is it that checkbox tag is not handling for Array of Values ??
18 years ago
Hi

Can any one provide links where it has something about internals of the Struts like design , techniques adopted and Patterns used inside Struts blah blah ...
18 years ago
Hi

I have a question which has something to do with fundamentals of Struts like why are the plugins introduced as new entities ?? We could have attained the same using Servlets(Loaded on Startup) with init() and destroy() method in Place and ServletContext scope also available to store the data.

We could have written tags as well to read the data from Context ..But what was the purpose for giving this plugins as seperate entities(Other than making them reusable entities)??

Any help regarding this would be appreciated
18 years ago
Hi

When a write an inner class inside a method , it can access the variables in the enclosing method if and only if they are final ... Why is the compiler enforcing this ??

What might be the reason for java doing this ?? Is it that these Local Variables will be cached for Inner class usage ??
18 years ago
Hi

Why won't java allow to return a value in finally block ??

public static void main(String[] args)
{
System.out.println("Method output is:"+ getValue());
}

public static boolean getValue()
{
try
{
return true;
}
catch(Exception e)
{
return false;
}
finally
{
return true; Here compilation error occurs
}
}

Is it that returning in finally overwrites the value returned in the catch block if the exception occurs ??
18 years ago