JTable: Allowing the highlight of a row with a right click

880 byte By Eliseo_Sotoa at 2007-9-30 0:14:08
Hi, this is my first post here. I'm using a JTable to display data from a JDBC ResultSet and I added a popup menu to the JTable (activated with the PopupTrigger) to display options related to the selected row like DELETE, UPDATE, etc.But the problem is that if you right click (the PopupTrigger ...

Monospaced font problems

771 byte By ExorcismTongsa at 2007-9-30 0:14:46
I am having problems with the monospaced font in Swing. It appears that the "O" (capital letter o) character has somehow been switched with the "0" (zero) character, because the letter shows up as the number and vice versa. The problem only happens with the "Monospaced" and "DialogInput" fonts, ...

method help

14308 byte By slider786a at 2007-9-30 0:14:48
I am trying to run this calculator, i need the calc method to run when the male Radio Button is pressed and the calcFemale method to run if the female Radio Button is pressed. The radioButton methos works for but the calcFemale one doesnt when the female Radio Button is Pressed. Please help, ...

set JTable column width

463 byte By cyshanga at 2007-9-30 0:15:02
Hi, I would like to set the column width of JTable.========================================JTable table;DefaultTableModel tableModel;tableModel = new DefaultTableModel();table = new JTable( tableModel);JScrollPane scrollPane = new JScrollPane(table);for(int i = 0; i < heading.length; i++) { ...

java.lang.NullPointerException

507 byte By javadeveloper2004a at 2007-9-30 0:15:43
Hi everyone,I face a problem: I want to call getCodeBase from a JApplet toload a sound. Instead I receive this NullpointerException.Can someone help me?import javax.swing.*;import java.applet.*;import java.awt.*;import java.awt.event.*;import java.net.URL;public class OpenFile extends ...

DefaultListModel

325 byte By dlaird1979a at 2007-9-30 0:15:46
I want to remove items from a list, however I do not want the list to reorder(shrink) i want all the old indices to stay the same.Can you setElementAt(index, null)So that the item is null and will not be displayed but will leave the size of the list the same?Hpe yo can ...

JFrame resize

230 byte By stylischSuna at 2007-9-30 0:15:51
Hi,i want my frame to be static in size, i.e. i dont want the user to be able to resize my frame.what method of JFrame can i use for this, i was not able to find an obious one in the API.ThanksJo

JTextArea

229 byte By stylischSuna at 2007-9-30 0:15:52
Hi,I was wondering how to jump from one JTextArea to the next using tap. I have a gui with two adjacent text areas, so pressing tap should make the curser jump from text area A to text area B.regardsJo

hoe to display scrollbar over the panel

632 byte By vchandramoulia at 2007-9-30 0:16:04
hi,i added jpanel object inside a jframe objects container as follows.setSize(570,470);panel=new JPanel();panel.setLayout(null);Toolkit tk=Toolkit.getDefaultToolkit();Dimension d=tk.getScreenSize();panel.setSize(d.width,d.height);JScrollPane sp=new ...

Choice of Text Component

232 byte By AlexRashevskya at 2007-9-30 0:16:13
Hi!I need the text component for image and text or only the text output. I also need scrolling, if it is needed, and auto line wrapping.In general, I need multiline JLabel with scrolling, line and word wrapping.

JWindow closing

171 byte By indianCoffeea at 2007-9-30 0:16:16
Hi!!Any ideas on how to close a JWindow, (i.e. to make it go away).A Jwindow does not have any 'close' buttons or any title bar. indianCoffee

How to draw lines on JLabel when the mouse moving?

333 byte By whuili_2003a at 2007-9-30 0:16:56
How to draw lines on JLabel when the mouse is moving? I would like to draw the coordinate lines (x - axle and y -axle) when I move the mouse, and the intersection point of the 2 lines is the mouse coordinate. The 2 axles will move with my mouse coordinate point, and the lines will display on a ...

Create my personal Listener

198 byte By ger8a at 2007-9-30 0:17:02
Hi, help me please, any one knows how i can create my personal listener for my personal Event?For example i want a listener for the change of the Font or other properties.Thanks

fails under XP

1355 byte By parano279a at 2007-9-30 0:17:30
I have an application that runs fine under win2000 but under winXP I have the following error. The problem here is I cannot find whats causing the error in my code, I dont have any internal frames... java.lang.ClassCastExceptionat ...

JToolBar rollover gone after updateUI.

1385 byte By mplexus2a at 2007-9-30 0:17:45
I set the rollover effect of the toolbar JToolBar.setRollover(true) and i pack the container (JFrame), usual stuff. The default L&F is used (metal) as i don't set any during initialization. Later, when I set another Look&Feel (even metal), the rollover effect is ...

Import JBuilder into Netbeans

407 byte By ETCHUAa at 2007-9-30 0:17:49
I have been using Jbuilder for a couple of years and was thinking about Netbeans. I use the GUI to build the swing windows that I need but when I try to import the same .java into Netbeans I can no longer see the GUIs. It appears that I will not be able to switch between different IDE's. Does ...

How to avoid Freezing ?

550 byte By swingfulla at 2007-9-30 0:18:04
I have a Jbutton in my Application that validate the customer id and according to the valid customer id it shows another frame ..sometimes that button freezes and gives no response to the user ..the same problem occures later in the next frame when the customer select a value from combobox, the ...

Mouse double click?

252 byte By ankit_engga at 2007-9-30 0:18:33
i cant figure out any way by which i can trap the double clickalso, how do i test which mouse button has been clicked?is there any class or inbuilt java functionality which lets me to the above mentioned tasks.......plz let me know

Tree refreshing

3126 byte By liat@bitband.coma at 2007-9-30 0:18:40
I have to reload my tree - and restore the expended paths.Before rebuilding the tree model - kepp the last nodes that were expended:and then after the building i search for these nodes at the new model (by id) and re expend them.unfortunetly - some of the nodes are not expended after this ...

JDK 1.3.1 - 1.4.x (Swing) differences

722 byte By nice_GUIa at 2007-9-30 0:18:45
Hi,Can anyone point me to a document/web page that contains ALL the changes that were done between 1.3.1 and 1.4.x ?I'm in particular interested in the changes that the Swing package has undergone, and even more importantly what can I do to keep the look & feel of my application as ...

JFrame - undecorated true + resizing and drugging

6673 byte By liat@bitband.coma at 2007-9-30 0:18:54
hiI would like to implement a Jframe that is not decorated but it has the abilities of resizing and drugging.I added my implementation here (which is taken from a combination of classes i found on the internet)- but it does not work good - the frame "jump" when it moved...I think the drugging ...

Combo Box in a JTable not appearing

1768 byte By patriveta at 2007-9-30 0:19:01
Hi Swing,I have a snippet of code that I took from the Swing guide for JTables that adds a JComboBox into the 3rd column in the table. However, the ComboBox doesnt appear?Can anyone see what is going wrong? Code is below:- I can post more if needed:-public void addTable() {tableModel = new ...

Combo Box in a JTable not appearing

1768 byte By patriveta at 2007-9-30 0:19:02
Hi Swing,I have a snippet of code that I took from the Swing guide for JTables that adds a JComboBox into the 3rd column in the table. However, the ComboBox doesnt appear?Can anyone see what is going wrong? Code is below:- I can post more if needed:-public void addTable() {tableModel = new ...

How to draw moving cordinate lines with mouse moving on a button?

474 byte By whuili_2003a at 2007-9-30 0:19:35
Hi,How to draw moving cordinate lines with mouse moving on a button? I would like to draw a x-axle and a y-axle on a button, and the intersection point is the point of the mouse. When mouse is moving, the 2 axles are moving with the mouse. I suceed in doing this on the a lable and a panel. but ...

Window closing

566 byte By smurf684a at 2007-9-30 0:19:47
HeyIn my program i set accelerator F2 for one of my menu item. I put the menu item to all the windows that open by my application.The problem come up is .. first i have window A and then coz user click something come up window B which is a non-modal dialog. The problem come up is .. eventhough ...

very simple JTable problem?

689 byte By staindfan12345a at 2007-9-30 0:20:07
Hello guys,can someone look at the code below and tell me how to add some code which enables two columns to be editable and not ust the one as stated below:public boolean isCellEditable (int row, int column ){return (column == datefrom);//I know it has to be added here but dont know how!?}The ...

JTABLE & RESIZE

532 byte By giscard_aiobaa at 2007-9-30 0:20:39
Hello guys, I'm having a little problem. I crate a JTable and I wanna resize it, fellow the width of the String in the columns, i.e, when I get a Query (many strings ditributed at many columns). I wanna get the biggest String at the "X" column and resize this colum.Another problem consist of ...

Displaying a picture

1007 byte By ChannelZa at 2007-9-30 0:21:04
Hello,Im trying to display a jpg picture, and i want it to resize the frame to the size of the picture This is what ive got so far:public class PopupManager extends JFrame {static String imageFile = "maniac.jpg";public PopupManager () {Image image = ...

Coloured Text

240 byte By lithuviena at 2007-9-30 0:21:09
I am trying to develop an editor for 8085 assembly language programming. I need to display all key words like MVI MOV ADD ADDI etc in a colour different than the rest of the text. How do I do it? Any help would b greatly appreciated.

Help with scrollbars

784 byte By lithuviena at 2007-9-30 0:21:21
My code goes like this:public class EditorPanel extends JPanel implements ActionListener{private JTextPane write;private JScrollPane scrollpane;public EditorPanel(){write = new JTextPane();scrollpane = new JScrollPane(write);write.setPreferredSize(new ...

JFrame Icon Doesn't Work When Launching JAR From Nautilus

967 byte By johnfivea at 2007-9-30 0:21:30
It seems that J2SE 1.5 beta 1 adds the necessary MIME settings to Gnome when one installs the J2SE 1.5 RPM on Fedora Core 1. This is great and I was delighted to see that JAR files can now be run by clicking on them in Nautilus. Finally! Anyway, the point of this post is to say that the window ...

Using Panels in Custom Cell Renderers.Please Help

2679 byte By bhuru_luthriaa at 2007-9-30 0:21:50
CHAPS.I wud like to use a JPanel in my custom cell rendererto return back the number of items in my list.So i want the display to be this:1Java2C++3CobolI wud like to use JPanel as the label can contain other components.But I am not getting the concerned output.Can someone please tell me where ...

JLabel Array NullPointerException

1370 byte By Follyaxela at 2007-9-30 0:22:20
Hai,I wan't to use an Array of JLabel, I don't know if this is possible, but my compiler seems to be okay with it.I'm using the next code for decleration:private javax.swing.JLabel[] lblApplicatieAlgemeen;and I'm using the next code to "create"(?) the labels:public void ...

Saving a file with Illegal characters. Help

1090 byte By javaswingusa at 2007-9-30 0:22:40
Hi,Please see the code below. I try to save a file with illegal characters and I need to display an error message and then show the JFiechooser back. I am having problems here.int tt = m_chooser.showSaveDialog(null);if(tt == JFileChooser.CANCEL_OPTION){....}else if (tt == ...

JFrame looks weird after minimizing...

523 byte By veroslava at 2007-9-30 0:22:52
My problem is that I want to start my GUI:s window minimized and then let user maximize it by clicking on it in the taskbar. But when window is maximized, the menu in the window is gone and it looks like the whole window is moved up so that some components cant be shown. What should I do? I ...

JTable Problem

162 byte By alejandrosha at 2007-9-30 0:23:13
Hi,I want to increase the number of rows of a JTable within a procedure!Is there a fast way to do it? I dont found it!Thanks!Al

Saving text - undesired notes

200 byte By mehappya at 2007-9-30 0:23:14
Dear experts.I am saving text to a file (new file). When I open the file there are some notes preceding the text. How can those undesired notes be eliminated?Thank you in advance.

Word Wrap

152 byte By zzpprka at 2007-9-30 0:23:20
Hi GuysI neec to use word wrap in JTable cells but can't figure-out how to do it; can any of you help me?Many thanksPatrick

JViewport.scrollRectToVisible() doesn't scroll backwards

1192 byte By skiingwiza at 2007-9-30 0:23:21
I have a JTable within a JScrollPane. I have a simple function that sets the selection to a single row and scrolls that row to be visible. All works as expected, except when the call to scrollRectToVisible() needs to scroll up (because the given Rectange is above the current view. Then it does ...

About JTable ...

468 byte By chris3388a at 2007-9-30 0:23:25
I have written a JFrame containing a JTable and a "next>>" button. If i have finished inputting all data into the table and press the next button, it always can't read the last data i have inputted.I think that the system believe i am editting the last cell and haven't finished yet when ...

International Chars

256 byte By AllenSchezara at 2007-9-30 0:23:41
Hi,Does anybody here knows how to make swing handle with chars like: ? ? ?, and so on...Always I use this kind of chars on a JOptionPane, or a JFrame, or whatever in swing, this chars are replaced by a dot-pointed square.Thanx !

Getting information about the current look and feel

280 byte By AndyJoela at 2007-9-30 0:24:02
Is it possible to get information about the colours and fonts used by the current look and feel? I am writing an extention to JButton, overriding paintComponent, and I want to paint the text using the normal font for a JButton, whatever look and feel is installed.AJ

Locating in a JTextPane object

223 byte By _ertria at 2007-9-30 0:24:15
How can I locate the cursor at a specific column in a specific line, say, line 1, column 1, in a JTextPane?Or is there an alternative that supports locating the cursor at a specifice column in a specific line?

Select from a,b to y,z

124 byte By _ertria at 2007-9-30 0:24:18
How can I set the selection to from a,b to y,z where a, y are line numbers and b, z are column numbers?Thanks!

LINE STYLES?

109 byte By ankit_engga at 2007-9-30 0:25:41
how do i draw lines with different styles, like the dashed, dotted, centre line, n other kind of line?

Reset location when changing JLabel's Text

283 byte By sheawha at 2007-9-30 0:25:51
Hello, I want to know why, when I execute JLabel's setText(String str) method, the JLabel's text will be set to value of str, but at the same time,the JPanel will reset the JLabel's location?Besides, how can I solve the problem?Thanks all

Update of JTable

244 byte By alejandrosha at 2007-9-30 0:25:58
Hi,I齰e change the data of a JTable from a Personal TableModel that inherites from AbstractTableModel.Anyone knows how to launch an update call so the Table is updated when I changed the internal data?Thanks,Al

Close Button in JTabbedPane

205 byte By Exclama at 2007-9-30 0:26:02
Hi everyone!one short question: how can I add close-Icons to a JTabbedPane? every panel should have a "X" - ImageIcon, so that it can be closed with a mouseclick.thank you!Guido

Custom Cursors and Dialog Boxes

695 byte By greaves_da at 2007-9-30 0:26:03
I have created and set a custom cursor in a JFrame in an application, but when I create a Dialog Box and move the mouse into it, the cursor changes back to the system default. Does anyone know how to fix this so the custom cursor is always shown? Also, the same thing happens if I move the mouse ...

JTable and ENTER

200 byte By L_D_Aa at 2007-9-30 0:26:42
Hi,when I press Enter in JTable, I want select next cell in the same row, not cell in next row.I can not use setSurrendersFocusOnKeystroke(true).How to do it ?Thanks