953 Posted Topics

Member Avatar for ilikepaste

how long I can't see old good assemler rounding method [CODE]a = a + .5;[/CODE] but rounding Double value in Jave should be [CODE] public class Round { public static double roundTo2Places(double value) { assert value >= Long.MIN_VALUE / 100 && value <= Long.MAX_VALUE / 100; long digits = (long) …

Member Avatar for ilikepaste
0
129
Member Avatar for arshalan
Member Avatar for jdm

[url]http://download.oracle.com/javase/tutorial/uiswing/components/table.html[/url] [url]http://www.java2s.com/Code/Java/Swing-JFC/Table.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Column.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Renderer-Editor.htm[/url] + [url]http://www.java2s.com/Code/Java/Swing-JFC/Table-Model.htm[/url]

Member Avatar for mKorbel
0
176
Member Avatar for churva_churva
Member Avatar for Abdel_eid
Member Avatar for Abdel_eid
0
152
Member Avatar for Progr4mmer

no idea just [CODE]String rate = calcu(textBox1.getText() + " " + textBox2.getText());[/CODE]

Member Avatar for Progr4mmer
0
225
Member Avatar for TheWhite

maybe not correct answer to your topic, but why not using for that some IDE (built-in funcioanlity),

Member Avatar for Ezzaral
0
121
Member Avatar for Progr4mmer

[CODE]I wanted to know if its possible to change the text of a JTextArea or JTextPanel[/CODE] yes [CODE]from another method[/CODE] yes [CODE]and if so how?[/CODE] well, but there are exists tons of methods that's descibed in API for exaxmple (with link to API too) [url]http://download.oracle.com/javase/tutorial/uiswing/components/textarea.html[/url] [url]http://download.oracle.com/javase/tutorial/uiswing/components/textfield.html[/url] [url]http://www.java2s.com/Code/Java/Swing-JFC/CatalogSwing-JFC.htm[/url]

Member Avatar for Progr4mmer
0
206
Member Avatar for whateverme

welcome on this forum [CODE] public static void main(String argv[]) { FVehicle driver = new FVehicle(); } [/CODE]

Member Avatar for mKorbel
0
423
Member Avatar for Akill10

why did you validate Date by using InputMask [url]http://download.oracle.com/javase/tutorial/uiswing/components/formattedtextfield.html#format[/url] add actionListener directly to the JButton, all methods pact to the separated void as f.e. doValidate() you have to set Focus to JComponents from void doValidate() int checkAge() 1/ value for Calendar and Date prepare outSide this methods, sure you can …

Member Avatar for mKorbel
0
325
Member Avatar for nHulk

start with [url]http://download.oracle.com/javase/tutorial/index.html[/url] and tons of examples [url]http://www.java2s.com/[/url]

Member Avatar for stultuske
0
118
Member Avatar for luijean

[url]http://download.oracle.com/javase/tutorial/uiswing/examples/components/ButtonDemoProject/src/components/ButtonDemo.java[/url] tutorial [url]http://download.oracle.com/javase/tutorial/uiswing/components/button.html[/url]

Member Avatar for mKorbel
0
122
Member Avatar for oldezwe

put that into JScrollPane f.e. [CODE]import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.*; public class SomeGridLayout extends JPanel { private final int VERT_STRUT = 100; private final int WEST_GRID_HGAP = 10; private final String TEST_BIGTEXT = "<html><body><h2>Path</h2>toto/tutu/tata/TestN<h2>" + "Prerequisites</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> " + "blahblah blah blah<h2>Description</h2>blah …

Member Avatar for mKorbel
0
677
Member Avatar for oldezwe

[url]www.mySQL.com[/url] [url]http://www.java2s.com/Tutorial/MySQL/CatalogMySQL.htm[/url] and google

Member Avatar for prem2
0
85
Member Avatar for CMAUK

yes that's possible, you can create methods [CODE] public JLabel myLabel{ //create JLabel return; } //or public class myLabel extends JLabel{ //create JLabel } [/CODE] samples code [url]http://download.oracle.com/javase/tutorial/uiswing/index.html[/url] [url]http://www.java2s.com/Code/Java/CatalogJava.htm[/url]

Member Avatar for mKorbel
0
175
Member Avatar for Abdel_eid

1/ what you are tried to tell ..., this man meaning runnable definitions about "how you wrote your JTable" 2/ be sure that more complete JTable definitions is just about 80-120 code lines, only for JTable 3/ and don't swith Input/Output to another JFrame, replace that with JDialog, 4/ "how …

Member Avatar for mKorbel
0
71
Member Avatar for PhiberOptik

hmmm how many post, my magic ball is tired, no idea how - where - why, only/maybe if you shows that

Member Avatar for mKorbel
0
59
Member Avatar for fugmag

Hmmm, please nothing to your topics 1/ maybe open connection on App startUp, close that on App Exit, to avoid long task during ActionPerformed (from JButton???), in your case GUI probably freeze for second and more ... 2/ there nothing about Object (mo), if is TableModel, TreeModel then you can …

Member Avatar for mKorbel
0
293
Member Avatar for Abdel_eid

JComponent#setComponentOrientation, please be sure that you will use a Swing Components, meaning start with letter "J", f.e. JTextField, JButton etc [url]http://download.oracle.com/javase/tutorial/uiswing/layout/using.html#orientation[/url]

Member Avatar for mKorbel
0
468
Member Avatar for iceregulus

welcome on this forum, [CODE] public class MetricConverterApp extends JFrame implements ActionListener{ JButton metWeight; public MetricConverterApp(){ . . . . . . metWeight = new JButton("Convert to kilograms"); jp1.add(metWeight, BorderLayout.EAST); metWeight.addActionListener(this); [/CODE] and every JTextField (where you want to input Numeric value) should be JFormattedTextField don't extends and implements in …

Member Avatar for mKorbel
0
1K
Member Avatar for Snoozey
Member Avatar for black_berry
Member Avatar for mKorbel
0
95
Member Avatar for Bayareaboy

be sure doing [CODE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Frm.FinalProject$CalcBtnListener.actionPerformed(FinalProject.java:88) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) …

Member Avatar for mKorbel
0
173
Member Avatar for sj5536

its nothing to do with java, even/but at fistr of all: are you search for some Camera set that's really implements your .. (camera chipset + Sw), aren't you if yes, then is: - camera able (automatic option for Face Detection) to create image - camera able (camera chipset + …

Member Avatar for mess110
0
153
Member Avatar for Neversleepin

long time i nothing to do (meaning compile, just import workbech) in Eclipse, but other IDE has project properties, where you can set main class by name (if needed with argument too, but I think that isn't your..)

Member Avatar for mKorbel
0
2K
Member Avatar for ComicStix

sure I don't understaodd exactly what are you tried to archieve, sorry my magic ball is tired, only continue by reads comment [CODE]System.out.print("Sorted");[/CODE] if I add [CODE]Arrays.sort(sel);[/CODE] then outPut ... [CODE] import java.util.Arrays; public class NicoleSelSort { public static void main(String[] args) { int[] sel = new int[100]; System.out.print("Unsorted"); for …

Member Avatar for ComicStix
0
162
Member Avatar for kukuruku
Member Avatar for mKorbel
0
117
Member Avatar for kumpul101
Member Avatar for techie929
Member Avatar for carinlynchin
Member Avatar for wonder_laptop

no idea, sure maybe this one can hepl you [url]http://www.trl.ibm.com/aglets/about_e.htm[/url] but carrefully reads this line "Last modified 14 March, 2002" on page bottom, and maybe works and on todays PC with Java 6 ask author for support

Member Avatar for mKorbel
0
112
Member Avatar for Neversleepin

[url]http://download.oracle.com/javase/tutorial/essential/exceptions/index.html[/url] but [CODE] If(files.length>0){// check array for (int i = 0; i < files.length; i++){ //some stuff } } if (file.exists()){ // check path //something with Drive, Folder or File } [/CODE]

Member Avatar for Neversleepin
0
178
Member Avatar for Neversleepin

maybe this one can help you with... [url]http://www.javaworld.com/jw-12-2000/jw-1229-traps.html[/url]

Member Avatar for mKorbel
0
1K
Member Avatar for wonder_laptop

that's very old API, isn't good idea 1/ remove import from MyDialog class, because isn't necessary ..., and used too [CODE] import com.ibm.agletx.util.SimpleItinerary; [/CODE] 2/ please there are Eclipse and Netbeans and both are free, there you can write/import, then debug/run your code more confortly as from command Line, 3/ …

Member Avatar for wonder_laptop
0
152
Member Avatar for Neversleepin

[url]http://www.java2s.com/Code/Java/Database-SQL-JDBC/Excel.htm[/url] but you have to create user DNS for MsExcel in Windows before that or by using Apache POI

Member Avatar for mKorbel
0
78
Member Avatar for kukuruku

then always check whether if it exists before for example on [url]http://www.java2s.com/Code/Java/Data-Type/CatalogData-Type.htm[/url] date Format, date Parser and Date, be sure that you'll put it together ...

Member Avatar for ~s.o.s~
0
200
Member Avatar for kvass

maybe there you can find ... [CODE] import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class GenerateProgresId { private static String[] aChar = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; private static …

Member Avatar for JamesCherrill
0
215
Member Avatar for BioJavaPhobic

huuuh...., please what are you tied with [CODE]#else if ((isConnected !=false) && (isConnected !=true)){[/CODE] you can test (if - if else - else) boolean value directly [CODE] if(isConnected){ if(OneKid){ //some stuff } if(!OneKid){ //some reversal stuff } //some stuff }else{ //some stuff } [/CODE]

Member Avatar for BioJavaPhobic
0
649
Member Avatar for Katana24

just some ..., no FW (that's about e.getSource()) - have to create GUI on EDT (main method) - have to place, size, pack TopLayoutContainer, and then visible container - you are set LayoutManager correctly, then there is no longer needed something about ContentPane, (hmmmm, sure backGround Color, but just for …

Member Avatar for ztini
0
2K
Member Avatar for kukuruku
Member Avatar for doyler
Member Avatar for odiejodie

please (if isn't there Ldap, AD...) be sure that you don't store sesitive (User + Psw) data in String form somewhere in your App, because all String variable (private Strin UseName = "John";) are readable (runnable compilated code) from any fileViewer (after compilation there you can find out "John"), that's …

Member Avatar for mKorbel
0
86
Member Avatar for MrHardRock

Swing is strictly single threaded, and all code must be done on EDT and your JComponents always wait for long iterations, GUI's freeeze during this long operation you have to move your iterations to the backGround Task 1/ using SwingWorker (this section contains Concurency, EDT a SwingWorker) [url]http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html[/url] be sure …

Member Avatar for JamesCherrill
0
225
Member Avatar for minghia

sure there is better to use a proper LayoutManager [CODE] Font font = jButton1.getFont(); FontMetrics fontMetrics = jButton1.getFontMetrics(font); maxWidth = SwingUtilities.computeStringWidth(fontMetrics, text); [/CODE]

Member Avatar for minghia
0
203
Member Avatar for BioJavaPhobic

[CODE] public boolean FailurePoint(int selectedNodes[], CyNetwork network) { int kids[] = network.getAdjacentEdgeIndicesArray(selectedNodes[0], false, true, true); int[] ChildNode = new int[kids.length]; for (int c = 0; c < ChildNode.length; c++) { int node = network.getEdgeSourceIndex(kids[c]); if (node == selectedNodes[0]) { node = network.getEdgeTargetIndex(kids[c]); } ChildNode[c] = node; } Vector<Integer> cnodes = …

Member Avatar for BioJavaPhobic
0
293
Member Avatar for MeandJava

maybe this one (if you needed pass path in String form) [url]http://www.java2s.com/Code/Java/2D-Graphics-GUI/DisplayimagesupportedbyImageIO.htm[/url] [CODE] try { image = ImageIO.read(new File(filename)); } catch (IOException ie) { ie.printStackTrace(); } [/CODE]

Member Avatar for MeandJava
0
2K
Member Avatar for ahmed_fawzy

that's simplier as I ever seen, what do you meaning about this one [CODE] import java.awt.*; import java.awt.geom.*; import java.awt.image.BufferedImage; import javax.swing.*; public class Background extends JPanel { private static final long serialVersionUID = 1L; private BufferedImage image; private Ellipse2D.Double ball; @Override protected void paintComponent(Graphics g) { Graphics2D g2 = …

Member Avatar for mKorbel
0
2K
Member Avatar for r0n

the you can (probably) use a some of Set, that doesn't allows duplicates, and you can test it with methods someSet#contains

Member Avatar for r0n
0
2K
Member Avatar for zyaday

there is basic inc. JTreeNode, Model etc [url]http://www.java2s.com/Code/Java/Swing-JFC/Tree.htm[/url] and [url]http://download.oracle.com/javase/tutorial/uiswing/components/tree.html[/url] and why swing doesn't works [url]http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html[/url]

Member Avatar for mKorbel
0
130
Member Avatar for StevoLord

1/ initial delay is int, where TimeUnit == miliseconds not 0010, sure for preprocesor is this "value" only 10miliseconds but... 2/ usage for java.swing.TImer shloud be (and check Timer#methods f.e. timer.setDelay(int i)) [CODE] private void prepareStartShedule() { timerRun = new javax.swing.Timer(delay / 10, startCycle()); timerRun.setRepeats(false); timerRun.start(); } private Action startCycle() …

Member Avatar for mKorbel
0
135

The End.