I have four JTextFields where user is allowed to enter only numbers. Question is how do I do this?

Member Avatar
Member Avatar
+0 forum 9

Does anyone can recommend some application to play Blu-ray on pc? I have CyberLink PowerDVD 8 that came with optical drive, but often there is a lag (visible stop in playback). I would love if VLC player people added BR support to application, but at the moment libbluray is more of trouble then success

Member Avatar
Member Avatar
+1 forum 7

I'm creating a jar file of my game to make it smaller and easier to transfer. I was able to created jar file out of my classes and include there images. Question is - how do I include txt file which is used for reading and writing?

Member Avatar
Member Avatar
+0 forum 11

Since we are already mentioned in [URL="https://github.com/search?q=daniweb&type=Everything&repo=&langOverride=&start_value=1"]few projects[/URL] ;) could we get official account where we may actually upload tutorials and link them in posts? That will also mean that someone will have to actively monitored or perhaps mods or selected members would be contributors.

Member Avatar
Member Avatar
+1 forum 10

Anyone following IIHF World Championship 2011 from Slovakia?

Member Avatar
+0 forum 0

I have file that contains Unicode characters from Latin-1 and Latin Extended A sets (link to [URL="http://unicode.org/charts/"]Unicode charts[/URL]). How do I read it so that these unicodes are converted to proper characters? I tried [code=Java] public void readFile(File file) { try { BufferedReader in = new BufferedReader(new FileReader(file)); String noneUTF; while ((noneUTF = in.readLine()) != null) { byte[] utfBytes = noneUTF.getBytes("UTF8"); String str = new String(utfBytes, "UTF8"); jta.append(str + "\n"); } in.close(); } catch (IOException ioe) { ioe.printStackTrace(); } }[/code] and [code=Java] public void readFile(File file) { StringBuffer buffer = new StringBuffer(); try { FileInputStream fis = new FileInputStream(file); InputStreamReader …

Member Avatar
Member Avatar
+0 forum 13

Would be possible to create "generic" sub-forum in Databases where we can place any db related stuff which doesn't fit into any of our present options?(MySQL, MS SQL, Oracle, MS Access and FileMaker Pro, Database Desing) Having something similar to Software Development sub-forum Legacy and Other Languages. Reason: Often there is no real place to move questions on SQLite, Derby, DB2, HSQLDB, Postgres, MongoDB and many others and have to leave them either in Software Development section with language they are used or IT Professionals' lounge. This is pointless specially if asked question is on user or admin side instead …

Member Avatar
Member Avatar
+0 forum 15

Ahh, long time since I was on pposting end :D Ok here it goes. The code bellow show mobile application that takes string from user and past it on to servlet. Servlet read it add extra data on front of message and send it back to mobile device that display this new message. My problem is the red marked part. I'm able to read correct length of sent bytes from server, I'm able to store it in byte array but can not convert back to string. application system calls will be like this [code]before transmit name=Peter length = 23 reading …

Member Avatar
Member Avatar
+0 forum 10

I have table something like [ID, ITEM_ID, URI, IMAGE_FILE_NAME, UPDATED_AT etc.]. I need to compare URI that can be something like /system/images/777/medium/Debrecen_-_University.jpg?1279547675 with IMAGE_FILE_NAME that is as Debrecen_-_Protestant_Great_Church.jpg Is there a way so I can provide IMAGE_FILE_NAME as sort of substring of URI and check if that substring is part of the string?

Member Avatar
Member Avatar
+0 forum 4

When I created new project I went to [I]Solution Explorer[/I] and in [I]Properties[/I] I double clicked on [I]Resources.resx[/I]. Here I clicked on [I]Add Resource[/I] and [I]Add Existing File[/I]. Selected images been added and I can use them for darg&drop on form. My problem is I need to create sort of rollover effect on pictureBox. PictureBox image property is set to none for start. When I go with mouse over pictureBox I want to upload image from resources. How do I do it? [code] pictureBox.Image = [COLOR="Red"]? ? ? ? ?[/COLOR][/code] PS: Any good place with C# tutorials?

Member Avatar
Member Avatar
+0 forum 7

I have this long winded query [code=sql]select i.id,i.name, i.item_type_id, (select it.name from items it, relations rel, relation_types relType where it.id=rel.to_id and rel.from_id=i.id and rel.relation_type_id=relType.id and relType.name='CityCtountry') as cityCountry from items i where i.item_type_id=2;[/code] Cut the long story short, we inherited database from customer that hasn't been happy with other company, but so far they refuse to let as redesign it so we have to deal with what we have. At the moment there is some 8k entries and about half of them are cities that I need to get from DB including a name of country they belong to. Above …

Member Avatar
Member Avatar
+0 forum 7

I have little bizarre problem. Working in Java web development we have project that we use plenty of templates from Velocity. Where one template can refresh section of it self and display one or more templates. My problems is that in parent template I have to pop up window with message if in child template and item from group A been moved to group B or vice-versa. Anyone has any idea how change on child template can be propagated up to parent?

Member Avatar
Member Avatar
+0 forum 3

I running my little blog on Tomcat 6 server. My hosting company allows me to set up multiple sub domains. I was trying to do for last few hours, but no luck. Having started with [code=xml] <Engine name="Catalina" defaultHost="mydomain.co.uk"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <Host name="mydomain.co.uk" appBase="/home/user/public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>www.mydomain.co.uk</Alias> <Context path="" reloadable="true" docBase="/home/user/public_html" /> <Context path="/manager" docBase="/usr/local/tomcat/users/user/tomcat/webapps/manager" privileged="true" antiResourceLocking="false" antiJARLocking="false" reloadable="true" /> </Host> </Engine>[/code] I added new host to engine as [code=xml] <Host name="code.mydomain.co.uk" appBase="/home/user/code_public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>code.mydomain.co.uk</Alias> <Context path="" reloadable="true" docBase="/home/user/code_public_html" /> </Host>[/code] I tried to also follow Virtual Hosting and Tomcat [URL="http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html"]1[/URL] and [URL="http://www.ex-parrot.com/pete/tomcat-vhost.html"]2[/URL] (2nd …

Member Avatar
Member Avatar
+0 forum 1

I'm looking to find out a way to drag and drop table rows between two tables. I reused jQuery example for[URL="http://jqueryui.com/demos/sortable/#portlets"] portlets[/URL], but that did not work to full satisfaction. [attach]13597[/attach] In above screen shot I added border, but that is just for illustration of the issue. Problems: [LIST=1] [*]As you will see from the code I have to work with relative measurement there for I use percentage. I wasn't able to enforce row width to fill in whole table. How do I force full row width? [*]Drag-able row are part of table body (tbody) and headers are done with …

Member Avatar
Member Avatar
+0 forum 1

I have installed Flash plugin for Mozilla how ever some pages containing flash will not work properly. For example[URL="http://www.bbc.co.uk/merlin/#/games/"] this game[/URL] (select Camelot Defence and Play Now) when I try to click on Play Game button it will not start (neither other 2 buttons respond). So where is the issue?

Member Avatar
Member Avatar
+0 forum 3

I will keep it simple. I need to list id of every element in given section. Example [code=html] <div id="leftSide"> <ul id="leftList"> <li id="item1"item 1</li> <li id="item2"item 2</li> <li id="item3"item 3</li> <li id="item4"item 4</li> <li id="item5"item 5</li> <li id="item6"item 6</li> </ul> </div> <div id="rightSide"> <ul id="rightList"> <li id="item2"item 2</li> <li id="item4"item 4</li> <li id="item6"item 6</li> </ul> </div>[/code] I need to get IDs for "li" items on the "rightSide" container. How to?

Member Avatar
Member Avatar
+0 forum 3

I need to read XML document submitted to doPost() method ( I do not want to upload it, just read in and pass for further processing). Here is a general code that I use for now to see if file been received. [code=Java] public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ServletInputStream sis = null; try { sis = request.getInputStream(); } catch (IllegalStateException e) { e.printStackTrace(); } if (sis != null) { print(sis); sis.close(); } } private void print(ServletInputStream sis){ java.io.BufferedReader br = null; try{ br = new java.io.BufferedReader(new java.io.InputStreamReader(sis)); StringBuilder sb = new StringBuilder(); String line = …

Member Avatar
Member Avatar
+1 forum 1

Currently I'm creating application to work with PDF documents, just for challenge. I want to know if there is better solution to my idea of possible approach. I broke down application GUI to four main components toolbar with image icons, jpanel for thumbnail preview, jpanel for single page view and main jpanel which group them together. Layout is same to traditional Acrobat Read and can be seen in attachment [attach]10534[/attach]. Now toolbar, thumbnail and single view panels need access and has to share a "PDFObject".( The PDFObject will of course have all necessary access methods.) What is bugging me is …

Member Avatar
Member Avatar
+0 forum 9

I'm looking forward to learn Core Spring and Hibernate. Which books would you recommend and some good online resources (beside their websites)?

Member Avatar
Member Avatar
+0 forum 3

I got components in layout as I wish to have them. Unfortunately 2nd row doesn't start as expected bellow first one, but directly under it (you can see portion of text draw on panel, should be visible whole). [attach]10549[/attach] I know that [LIST] [*]toolbar should have height of 60 [*]sidebar where thumbnails goes will be wide 185 [*]rest of the parameters are relative [/LIST] I tried to move two panels from second row to completely separate panel, but it sort of back-fired as they then did not show at all. [code=Java] import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import …

Member Avatar
Member Avatar
+0 forum 3

I'm having small issue with drawing on panel. Neither image or text appears, however background is set correctly therefore it has to be due some issue inside my paintComponent() method. [code=Java] import java.awt.Graphics; import java.awt.Color; import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO ; import javax.swing.JPanel; public class RottrThumbnailsPanel extends JPanel{ RottrThumbnailsPanel(){ init(); setBackground(Color.BLUE); setSize(new Dimension(400,400)); this.setVisible(true); } private void init(){ repaint(); } public void painComponent(Graphics g){ super.paintComponent(g); BufferedImage img = null; try{ img = ImageIO.read(new File("/pdfrotator/res/img/open_green.png")); } catch(IOException ioe){ ioe.printStackTrace(); } g.drawImage(img, 100, 100, 50, 50, Color.WHITE, this); g.setColor(Color.BLACK); g.drawString("Hello Peter", 0,200); } } [/code]

Member Avatar
Member Avatar
+0 forum 2

[B]This is not a question just small challenge[/B] if you interest in improving provided solution and feedback for me. I just went back to some assignment I did at university and one of these been design phone book for mobile device with use of Java Microedition (JME). At the time I had no time to play around with certain functionalities and this included contact sorting. Initial contact list display only contact name and first number associated with the contact, plus ID from Record Management Store (RMS) to for easier contact look up. These contacts are kept in ContactListLabels [code=Java] public …

Member Avatar
Member Avatar
+0 forum 6

After numerous issues with my first hosting I got new deal. Now I want to get my blog move to its new home, but I hit the wall with simple WAR deployment Here is catalina.log [code]INFO main org.apache.catalina.core.StandardService - Starting service Catalina INFO main org.apache.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/5.5.26 INFO main org.apache.catalina.core.StandardHost - XML validation disabled ERROR main org.apache.catalina.core.ContainerBase.[Catalina].[peterscorner.co.uk].[/] - Error configuring application listener of class com.sun.faces.config.ConfigureListener java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3712) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) …

Member Avatar
Member Avatar
+0 forum 5

I have two questions ( these may be very simple, but I'm concentrating on different things so I need somebody push me in right direction as not to waste time, bold said but that is reality) [LIST=1] [*]Passing object from top component to lower ones I have GUI where after successful login main frame keeps hold of user unique ID and pass it down to lower components by the use of constructor. It is very inefficient as the frame holds an panel in which I'm displaying different panels that are often combinations of other panels. So this unique ID is …

Member Avatar
Member Avatar
+0 forum 10

In the JFrame I have two components JMenuBar and JPanel. A selection in one of the options in menu bar change the content of panel as [code=Java]JMenuItem jmiAddEmployee = new JMenuItem("Add Employee"); jmiAddEmployee.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { mainPanel.removeAll(); mainPanel.add(addEP); validate(); } });[/code] This will replace the content, unfortunately if the previous components in the old one been longer then the new ones I will get new components with bits of old where the content is shorter. Is there any solution to this problem or do I need to swap my JMenuBar+JPanel for JTabbedPane?

Member Avatar
Member Avatar
+0 forum 10

I working on assignment to create bank management GUI with swing. Right now I'm messing with login. Instead of using JDialog as many may suggest to use I used JFrame. [attach]8150[/attach] In case of any error messages on login attempt I wanted to display error above all previously displayed content, however that will end up with message to be displayed next to original content [attach]8152[/attach] However if I swap order of GridBagConstrains , to show message at the bottom, the layout is correct :?: [attach]8151[/attach] I must be doing something somewhere wrong when I either clear or re-build the frame. …

Member Avatar
Member Avatar
+0 forum 8

I was under impression that declaration of [icode]char(4)[/icode] can store only values of [B]exact length[/B] of 4 characters. However I was able to insert empty string and strings of less characters than 4. Is there some datatype that will only accept string of declared length? Strings with less characters should be refused. Or I'm left only with application logic to check desired string length?

Member Avatar
Member Avatar
+0 forum 3

I made fresh installation of Windows XP Pro which previous times went without any troubles. However now I'm getting error 0x80096010 and I'm not able to install any software, if I try I get message such as "Extraction failed. File is corrupt." I tried to check certificates as many discussion forums recommend but did not succided yet.

Member Avatar
Member Avatar
+0 forum 11

I created menu for mobile phone, where after you make move screen should be repainted and after that a sound should be played. However at present stage sound is played first and just after that Canvas view is repainted. Bellow is skeleton of the class [code=Java] public class ContactMenu extends Canvas implements CommandListener { public ContactMenu() { backCommand = new Command("Back", Command.BACK, 0); addCommand(backCommand); selectCommand = new Command("Select", Command.SCREEN, 2); addCommand(selectCommand); setCommandListener(this); backImg = il.loadImage("se_logo2.jpg"); } public void paint(Graphics g) { //All drawing activities playSelected(); } public void commandAction(Command c, Displayable d) { if(lastCmd.equals(c.getLabel())) { if (c == backCommand) { …

Member Avatar
Member Avatar
+1 forum 6

I'm working on an application that simulated process of writing text message on mobile phone. On the canvas I first draw already typed message. If any and on button pressed I retrieve correct set of characters. Here I'm able to loop through them and highlight currently active/selected character. However I need to hide this set of characters lets say after 2 sec. I made two attempt to solve this problem but both do not work properly. [B]Timer[/B] [code=Java] public void keyPressed(int key) { //Rest of the function that is not relevant to problem charSet = true; repaint(); if(nml.getThreadState()) // boolean …

Member Avatar
Member Avatar
+0 forum 7

The End.