Window close button exit problem

1213 byte By aaronngraya at 2007-9-30 1:03:57
Given an onExit() method that is registered as follows :-mainFrame.addWindowListener( new WindowAdapter() {public void windowClosing( WindowEvent e){onExit();}});and the onExit method :-public void onExit(){if (modifiedData){if ...

ANN: jga release 0.5 available: trying hard to not crosspost

1158 byte By dhalla at 2007-9-30 1:04:13
Greetings:I've posted the availability of a library that I've been working on over in the generics forum. http://forum.java.sun.com/thread.jsp?forum=316&thread=495052Rather than make this a blatent cross post, I thought I'd try this instead. The reason why I think folks reading this ...

Help need urgently

353 byte By akb205a at 2007-9-30 1:04:46
Hi friends, i have a problem. It is that i have to compare two strings which are not equal. the famous "!=", does not work. in fact i have a do while loop, where i have to compare two strings till the are not equal. the code are:do{Sytem.out.println("Input: ");// value inputted;} while( ...

Line Numbering in Java

8538 byte By J_Flasha at 2007-9-30 1:04:55
I've got a code that I wanna use in the future but I'm having a problem in it.This line numbering codes works except if you try to open a file it would not open the file.Does anyone know a way to solve this :import java.awt.*;import java.awt.event.*;import javax.swing.*;import ...

Urgent!!!!!!!! Close of the whole application when a child dialog is closed

506 byte By ijaazatha at 2007-9-30 1:05:11
In my project there is a main frame. This frame will show up dialogs when some menu is clicked. In these dialogs, I am using constructor super(frame, true)where "frame" is the main frame which shows up the child frames. The problem is whenever I click on the close button on the top right corner ...

JTable - How to force displaying of "..." when column not large enough

561 byte By hchagnota at 2007-9-30 1:05:37
Hi,I use a JTable (associated to a model and a scroll pane) and I want to display "..." at the end of a cell content when the column is not large enough. I do not want to use an horizontal scroll, I just want to inform users that data in this cell isn't entirely displayed. For the moment, the ...

Popupmenu with keyboard navigation

391 byte By RoustNissena at 2007-9-30 1:05:47
Hi,I know this one has been out there a couple of times, but Im having trouble with activating the jpopup by keyboard, and moving it according to the caretposition.Lets say that the popup should be visible when ever the '<' char has been typed, and should then stay visible and move untill ...

Positioning components at random locations on a panel

238 byte By RyanSlandera at 2007-9-30 1:05:57
Hi,I am pretty new to swing. Here's what I need to know: Is it possible to place components at random locations on a panel? For example by just specifying the x-y coordinates? code sampes would help.ThanksRyan

Highlight Listener?

263 byte By Oliver.Andricha at 2007-9-30 1:06:02
Hi,I am working with a JTextPane and I would like to receive some kind of notice, when text is highlit in my JTextPane by mouse selection. Based on this I like to make some actions available or not.Any ideas?Best regards, Oliver

JTree refresh without collapsing my nodes

1114 byte By Korvusa at 2007-9-30 1:06:09
Hello,I have a JTree using a custom TreeModel. I've also extended the TreeNode. What is the most elegant method to refresh the tree or only a node withoutcollapsing the currently expanded nodes?Please note that there are multiple types of TreeNodes each representinga different object to ...

JList problem regd FOCUS.Please Advise...

2412 byte By bhuru_luthriaa at 2007-9-30 1:06:17
Hi,How do I set the focus on the first element of this list rather than clicking via the mouse?I'd like the focus to come to the first element by default and then move the up and downarrow keys?Can anyone help?class Test extends JFrame {Test() {JList list = new JList(new Object[] { "1", "2", ...

JButton

425 byte By sjon123a at 2007-9-30 1:06:21
HiI'm trying to make a JButton and a JLabel in a line, but only the button can be displayed, and the JLabel won't be shown at all. They do work seperately. I looked through many examples, but cannot get the solution. What I would like is something like this layout: < Item ...

Event for cell change

133 byte By maldiva at 2007-9-30 1:06:22
Hello,how is it possible to determine in a JTable if a user switch from the actual cell to an other cell? Tanks!

Changin tabbed pane using a JButton

548 byte By paul@paullee.coma at 2007-9-30 1:06:24
Hi all,I'm trying to include a button on a tabbed page that will enable you to switch toanother page.I'm using the following code:FlyProGen.addActionListener( new ActionListener() {public void actionPerformed( ActionEvent e ){tabbedpane.setSelectedComponent( container );}} );However, I get ...

JPopupMenu item selection

456 byte By The_Assimilatora at 2007-9-30 1:06:40
I have created a standalone JPopupMenu in my application, which functions as a context menu: it appears when the user right-clicks. My issue is that Java, by default, selectes the first item in the JPopupMenu when it is shown - I don't like this behavior, I would prefer it if the menu would ...

problem in printing form

100 byte By islamvipa at 2007-9-30 1:06:52
pleze i've form and wanne to print this formi wanne sample code for this thanx

ONMOUSEOVER IN JEDITORPANE

115 byte By tlloretia at 2007-9-30 1:06:57
hi!how can i change an image in a jeditorpane when mouse passes over it ?thankstlloreti

Using JDialog to pass values

508 byte By pateldwa at 2007-9-30 1:07:04
Hi ,Im want to use a JDialog to pass user values to the following types:connection = new XMPPConnection ("localhost");connection.login ("pateldw", "intel1");As you can see that localhost is the server, pateldw is the username and intel1 is the password. At the moment it is harcoded, but I want ...

Finding the relative position within a parent container

1341 byte By puckstopper31a at 2007-9-30 1:07:30
Ok, here's the scenario.1] We have the following classes; DrawingPanel extends JLayeredPane DrawingContainer extends JPanel DrawingObject extends JPanel TemporalRelationshipNode extends Point TemporalRelationshipRenderer extends 2DLine2] The following relationships exist DrawingPanel serves ...

JEditorPane flickering with insertion and removal in the Document

3204 byte By aspiringcodera at 2007-9-30 1:07:53
Hello there,I am using JEditorPane for an editor. For inserting a single letter, (because of the nature of the application), first I record/store the cursor position in a variable, then I am removing the entire document, Insert the changed text in the document, set the cursor position to ...

Help, JProgressBar not showing!

1585 byte By filtorontoa at 2007-9-30 1:08:17
Hi to all!Can anyone show me how to correct this code? I am expecting a JProgressBar to show but it never does.What am I doing wrong?Here is my code:import java.awt.*;import java.awt.event.*;import javax.swing.*;public class TProgressBar extends JFrame implements ActionListener{ private static ...

Nested JScollPanes and Mouse wheel

332 byte By Gusgus84a at 2007-9-30 1:08:26
I have several JScrollPanes within a larger JScrollPane, and the deault action when the mouse wheel is moved is to scroll the pane with that the mouse is over.....but I want it to act more like internet exploer where nested scrollPanes are only scrolled with the mouse wheel when they have ...

HOT Key choosing.Please see my code and suggest

2818 byte By bhuru_luthriaa at 2007-9-30 1:08:28
Hi,I am getting this strange behaviour.I have a cell renderer which displays a list in flwg format:1.[gif] Text6.[gif] TextI have written a small HOT KEY Funtionality.If I press HOT KEYS1,2 OR 3,focus goes to the concerned elements.But not got 4,5 or 6?Can anyone tell me whats wrong if ...

Display Image in JTextArea

649 byte By pateldwa at 2007-9-30 1:08:29
Hi, I would like to know how to display a image in a textarea. The displayed image i need to display is in color.I have the following code, but this displays it in gray.textArea = new JTextArea (){final ImageIcon imageIcon = new ImageIcon("top.jpg");JTextArea textArea = new JTextArea() {Image ...

JProgressBar only displays once...

3260 byte By jerry5104a at 2007-9-30 1:08:36
Please help..... I have this code. listed below, that will display the progress bar correctly if called BEFORE I open the main frame in my app... If I call the code elsewhere, i.e after the user has selected a data transfer, the dialog box displays but the progress bar does NOT. public boolean ...

JTable: Dynamically populate JTable

504 byte By Rahul.Joshia at 2007-9-30 1:08:51
I declare a JTable using the constructor JTable(int numRows, int numColumns) with numRows = 10, and numColumns = 10. When actually setting the data in the JTable using setValueAt method, if I have data only in 5 rows, I will iterate using for loops and set the values in the cells for the first ...

JTable not working with tableChanged

2272 byte By raj_cmu2a at 2007-9-30 1:08:57
Hi,I have a JTable and I use table model. I also use TableCellRenderer. Now when i use tableChange() method the method getValueAt(int nRow, int nCol) in the model is called recursively forever. It starts with row zero to row 7 and then starts again. I have spent quite some time on it and have ...

JComboBox

1051 byte By Rajeev_Chintaa at 2007-9-30 1:09:06
I am using two JComboBox's . I want to implement the event listener as Inner Class for both combo boxes.(Not Anonymous Inner Class)Following is the Code. It is not working//Event Listenser EventLis evlis = new EventLis();cbFonts.addActionListener(new EventLis());cbSizes.addActionListener(new ...

Customizin JTree

285 byte By krijgerda at 2007-9-30 1:09:22
Hi everyone,I want to use a normal JTree, but I want to add checkBoxes so that if I check a branch node all its children get selected (just like some installation programs or like PC-cillin antivirus). Does anyone have an idea how to do that?ThanksAlejandro

Spring Layout discussion

1019 byte By dman478a at 2007-9-30 1:09:52
Spring layout is an amazing layout concept, but when it comes down to it, its almost useless.If you have ever tried it, you can set dynamic or static distances between objects. This is useful because it is cross-OS because the components can change size and still be X away from each other. Each ...

Alt key causes NullPointerException

369 byte By edgilmorea at 2007-9-30 1:09:57
I am getting a NullPointerException in a Swing based GUI application when I use the 'Alt' key with JButtons containings mnemonics.There was an earlier topic of the same issue traced to either setLookAndFeel() or using a Frame instead of JFrame. I am using a JFrame and not using ...

whiteboard, line size

163 byte By peter_dublina at 2007-9-30 1:10:04
how do i increase the width of the lines im drawing on my whiteboard?at the moment they are very narrow, i want a larger "point size" ? thanks

JTabbedPane how to add some logo in the Tabs area?

831 byte By adrpit0a at 2007-9-30 1:10:25
Hello,I was wondering if there is any way of adding some logo or any icon at the right side of the tabs area without that the JTabbedPane has all it's horizontal size full of tabs..______| _TAB1__| | __TAB2__| _TAB3__| |__TAB4_| ...

Subclassing JTableHeader

6092 byte By JCDoerringa at 2007-9-30 1:10:28
Ok, this is probably been answered before but I seached and couldn't find the answer. I am going to write my own JTableHeader subclass for a project I'm working on. So far I've barely gotten into it and I've already found a problem. Normally when I drag a column you can see a grey area ...

Problem with Icon in JCheckBox

211 byte By krijgerda at 2007-9-30 1:10:32
I have a problem with a JCheckBox, when I assign an Icon to it, the checkBox dissapears and the only thing I see is the Icon. Is there a way to have the CheckBox and the Icon?ThanksAlejandro

setValueAt method()

3138 byte By justinwalker80a at 2007-9-30 1:10:40
I have little experience with swing...... can anyone give me a few pointers on how i would insert data in cells in a table and save them to a database. i want to do this using the setValueAt method. i am using a DAO to connect to the database. This is what i have so far.....public void ...

layout with 2 components on oposite sides of JFrame

1433 byte By oldmicaha at 2007-9-30 1:10:50
Hello all,I feel like I'm missing something really obvious, but I've been trying to layout a JPanel which extends the whole width of my JFrame and contains a button on either side. i.e.left frame edge-> | |button|<empty space here>|button| | <-right frame edgeI'm pretty sure I ...

How to respond to delete key in JTree

85 byte By aaronngraya at 2007-9-30 1:10:51
How do you catch key events in a JTree or any Java component for that matter ?

Design problem with JScrollPane

836 byte By Esteban1974a at 2007-9-30 1:11:05
First, I have problems with english. I hope u understand without problems that Im trying to say here. Sorry about that.Mi problem is whit a JScrollPane. I want to put an image whit a predefined size for draw inside it. I dont have any information about it, just the size. I want to put it in a ...

Printing a JTree with custom icons.

3663 byte By yeldudsivarta at 2007-9-30 1:11:07
I'm having a problem with printing a JTree. I am creating custom icons for each leaf of the tree based on a few parameters stored in a class that extends the DefaultMutableTreeNode class. All of this works wonderfully, until I try to send it to the printer. At this point the custom icons do ...

JTable Cells with different Color according to value

1067 byte By obinna_eke123a at 2007-9-30 1:11:17
Pls help I want to be able to display all rows (students) that paid more than 20 naira in Green else display rows (student) that paid < 20 naira in redBut at the moment it is displaying everything in green why?tmp is the variableCode would help pls!class TestRenderer extends ...

Start CellEditing on Cell Selection

751 byte By dotski81a at 2007-9-30 1:11:22
I have replaced a celleditor in a jtable to use a JFormatted textfield. On a single click the editors component is given focus (which I listen to and select the whole field). I get a different behaviour when I navigate to the cell via the keyboard and start typing. This seems to be common for ...

Using JTextArea as a log

414 byte By Aikidoka69a at 2007-9-30 1:11:34
I'm trying to use a JTextArea as a log. I'm using invokeAndWait in an attempt to make it not move on to the next line of code until a line of text has been appended to the JTextArea. The next lines of code are not Swing event-handling or painting, so I'm not sure if the SwingUtilities is ...

JTable Problem

613 byte By alejandrosha at 2007-9-30 1:12:05
Hi, let see if I can explain my problem....I,ve a JTable with Double in its cells. I use a TableModel where I specify the columns and store the data using an Object[][] array and storing Double.The JTable shows me the numbers with an specified format:When the number is decimal uses a "," to ...

JDialog from a JApplet is not on top...

654 byte By peteriyera at 2007-9-30 1:12:17
hai everyone , i have an applet which upon clicking a button shows a JDialog...i have the jdialog as modal and i want that to stay On top Always ( something like Always On Top option).when ever i visit some other application and come back to this web page i see that the jdialog which popped us ...

Setting text in 2 separate lines on a button

214 byte By santunupa at 2007-9-30 1:12:32
Hi,I am facing problem while setting text in 2 separate lines on a JButton.Could any one please let me know how to do that. Any sample code would be highly helpful.cheers,shantanu

Is there any replacement to this function:getFontMetrics

218 byte By liat@bitband.coma at 2007-9-30 1:12:39
I noticed that the function Toolkit.getDefaultToolkit().getFontMetrics(Font) is deprecated but i didnt find anything that replaces this functionIs there a replacment?thanksLiat

GridBagLayout

591 byte By alejandrosha at 2007-9-30 1:12:52
Hi, I will try to explain my problem,I want to use a GridBagLayout for laying out the following components:In first line one label for positions 2 and 3.In second line one label and two entries in positions 1, 2 and 3.In first and second line, one label that fill both lines and positions 4 and ...

Position JDialog around mouse position

611 byte By pfung99a at 2007-9-30 1:13:00
I am trying to make my modeless dialog show up centered at the location where I receive a mouse click message. Since JDialog.setLocation() uses x and y relative to the frame the dialog is associated with, I need to translate the coordinate from my scrollable panel to the frame's coordinate. ...

How to make text more sharp- very urgent

166 byte By basotiaa at 2007-9-30 1:13:08
I am displaying some text on applet. but the text displayed is not sharp.Can anyone suggest me how to make text more sharp in whatever font iuse.