Search Results

Search found 18003 results on 721 pages for 'nidhinzz own'.

Page 24/721 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • jframe adding own design jinternal frame error

    - by Van Minh
    I designed a title bar color on my JInternal frame. Then I took attempt to add it to my JFrame, but I cannot. Here is the code of my title bar: public class MyIFtitleBar extends BasicInternalFrameTitlePane { public MyIFtitleBar(JInternalFrame jif) { super(jif); } protected void paintTitleBackground(Graphics g){ g.setColor(Color.pink); g.fillRect(0, 0, getWidth(), getHeight()); } } Here is my JInternal frame. I tried running it in its psvm method, that worked! public class FitnessProg_Frame extends javax.swing.JInternalFrame { public FitnessProg_Frame() { initComponents(); this.setUI(new BasicInternalFrameUI(this){ @Override protected JComponent createNorthPane(JInternalFrame jif) { return new MyIFtitleBar(jif); } }); } @SuppressWarnings("unchecked") private void initComponents() { setBackground(new java.awt.Color(255, 255, 255)); setBorder(new javax.swing.border.MatteBorder(null)); setTitle("Fitness Progarm"); setPreferredSize(new java.awt.Dimension(507, 304)); pack(); } } But when I add it to my JFrame I get an error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException Here is my JFrame code: public class NewJFrame extends javax.swing.JFrame { public NewJFrame() { initComponents(); FitnessProg_Frame ff = new FitnessProg_Frame(); ff.setVisible(true); mydes.add(ff); // this line made errors } @SuppressWarnings("unchecked") private void initComponents() { mydes = new javax.swing.JDesktopPane(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); javax.swing.GroupLayout mydesLayout = new javax.swing.GroupLayout(mydes); mydes.setLayout(mydesLayout); mydesLayout.setHorizontalGroup( mydesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 400, Short.MAX_VALUE) ); mydesLayout.setVerticalGroup( mydesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 300, Short.MAX_VALUE) ); getContentPane().add(mydes, java.awt.BorderLayout.CENTER); pack(); } public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewJFrame().setVisible(true); } }); } private javax.swing.JDesktopPane mydes; }

    Read the article

  • Can an app delete its own internal resources?

    - by user637884
    I am trying to find a way to delete an internal resource after an app installs. More specifically, I have a zip file included in the apk, that I unzip to the SD Card when the app is first run. But then want to delete the now unneeded zip file (the purpose being to save the user internal phone memory). I access the zip file with, Resources resources = this.getResources(); InputStream is = resources.openRawResource(R.raw.assets); But am uncertain how to then delete the resource (if even possible). I know one may ask why not simply install the app to SD Card at download. But the app includes a screen widget, and installing apps to the SD Card and using a screen widget is problematic. Thanks, Matt

    Read the article

  • tor api in own project

    - by Ockonal
    Hello, I'm going to develop gui-based application for tor controlling (like vidalia or torK). Are there any libraries for using tor? I don't want to parse each byte of information from sockets. My program should display branches of computers, use chosen as traffic-provider etc. What I need in my case? Are there any small and simple samples (for example open-source projects) to do this.

    Read the article

  • PHP unlink OR rewrite own/current file by itself

    - by Email
    Hi Task: Cut or erase a file after first walk-through. i have an install file called "index.php" which creates another php file. <? /* here some code*/ $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<?php \n echo 'hallo, *very very long text*'; \n ?>"; fwrite($fh, $stringData); /*herecut"/ /*here some code */ after the creation of the new file this file is called and i intent to erase the filecreation call since it is very long and only needed on first install. i therefor add to the above code echo 'hallo, *very very long text*'; \n ***$new= file_get_contents('index.php'); \n $findme = 'habanot'; $pos = strpos($new, $findme); if ($pos === false) { $marker='herecut';\n $new=strstr($new,$marker);\n $new='<?php \n /*habanot*/\n'.$new;\n $fh = fopen('index.php', 'w') or die 'cant open file'); $stringData = $new; fwrite($fh, $stringData); fclose($fh);*** ?>"; fwrite($fh, $stringData);]} Isnt there an easier way or a function to modify the current file or even "self destroy" a file after first call? Regards

    Read the article

  • Keeping User-Input UITextVIew Content Constrained to Its Own Frame

    - by siglesias
    Trying to create a large textbox of fixed size. This problem is very similar to the 140 character constraint problem, but instead of stopping typing at 140 characters, I want to stop typing when the edge of the textView's frame is reached, instead of extending below into the abyss. Here is what I've got for the delegate method. Seems to always be off by a little bit. Any thoughts? - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { BOOL edgeBump = NO; CGSize constraint = textView.frame.size; CGSize size = [[textView.text stringByAppendingString:text] sizeWithFont:textView.font constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap]; CGFloat height = size.height; if (height > textView.frame.size.height) { edgeBump = YES; } if([text isEqualToString:@"\b"]){ return YES; } else if(edgeBump){ NSLog(@"EDGEBUMP!"); return NO; } return YES; } EDIT: As per Max's suggestion below, here is the code that works: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { CGSize constraint = textView.frame.size; NSString *whatWasThereBefore = textView.text; textView.text = [textView.text stringByReplacingCharactersInRange:range withString:text]; if (textView.contentSize.height >= constraint.height) { textView.text = whatWasThereBefore; } return NO; }

    Read the article

  • jQuery Address plugin: I want to manage the tracking on my own

    - by bfred.it
    I'm using the great (IMHO) jQuery Address plugin but it's been driving me insane since I didn't know that it automatically tracked the pages on Google Analytics. How do I keep it from doing it? I tried this but apparently it's never called. $.address.tracker(function(){console.log("hello")}) I guess I could somehow overwrite the function in the plugin but I hope there's a better way...

    Read the article

  • wordpress use in own template

    - by Andy
    Hi, I've created an HTML page as part of my website which I would like to use as a template for news articles. The page has all the things it needs, it just needs to display the correct news article in it. I installed WordPress on my webserver and now wonder how I can have wordpress publish articles using my HTML page? Is this even possible since WordPress works with php? thanks

    Read the article

  • Java: Comparing a class with another within that class using a my own .equals

    - by user1670252
    I am making a method .equals replacing the equals method used. It accepts a object. I want it to check if that object equals the class that runs the .equals class. I know I want to compare all the private methods I have to that object. Is there a way to do this without making another private class to get the private variables from the object? How do I do this to compare equality not identity? I am stuck on this. Do i have to use == to compare? Also looking online i see others use recursion. If this is the way i have to do it can you show and explain it to me? so an example i have public boolean equals(Object o) { this is in a class we will call bobtheBuilder (first thing to pop in my head) I want to check if the object o is equal to the class he has private object array and a private int. I assume I want to check if the array and int of this class equal the array and int of the object.

    Read the article

  • Using htaccess rewrite to make a subdirectory be its own root for root relative path requests

    - by Scott
    Can I use htaccess to capture requests from a certain subdirectory and make that directory use itself as the root directory for any root relative path requests? For example if I have... http://www.example.com/subFIXED/subANY/restofpath ...where subFIXED is always the same directory, subANY is any immediate subdirectory of subFIXED, and I want a redirection of all href/src requests from any file under subANY to use subANY as the 'root' (sort of like a subdomain), in effect having root level requests use this as the root directory level: http://www.example.com/subFIXED/subANY/ Instead of this: http://www.example.com/ I'm assuming I can put an htaccess file in subFIXED to handle all calls coming from anything under any subANY, but not being very familiar with htaccess rewriting, variables, etc., I can't figure out how to capture which subANY directory is making the root level request and then use that capture to make a rewrite to consider that directory the root level of any root relative path requests from it. Thanks for your help

    Read the article

  • Project hosting vs. my own SVN

    - by BigG
    I'm working on different projects with some small teams (2-3 people for each). Those projects are about some scientific stuff, most (probably all) the code will be released under GPL after the publication of some results and we don't want to spend money for this. My first question is: should i keep my local SVN server or you know some good service for this? Both of them have some disadvantages and services like xp-dev.com looks pretty interesting but should i trust them? [i'll get only the free plan] Online services give you some tools for project management, what do you think about them?

    Read the article

  • How do i create my own Token?

    - by EugenA
    I use Rules-Module. I want to add 1 to a cck integer field on an action. Someone told me to create custom token doing this addition. So, I installed tokenSTARTER module. Now, how do i access the content profile (I load it in the rules chain) where needed cck field is in?

    Read the article

  • own drawImage / drawLine in OpenGL

    - by Chrise
    I'm implementing some native 2D-draw functions in my graphics engine for android, but now there's another question coming up, when I observe the performance of my program. At the moment I'm implementing a drawLine/drawImage function. In summary, there are following different values for drawing each different line / image: the color the alpha value the width of the line rotation (only for images) size/scale (also for images) blending method (subrtract, add, normal-alpha) Now, when an imageLine is drawn, I put the CPU-calculated vertex-positions and uv-values for 6 vertices (2 triangles), into a Floatbuffer and draw it immediately with drawArrays, after passing information for drawing (color,alpha, etc.) via uniforms to the shader. When I draw an image, the pre-set VBO is directly drawn after passing information. The first fact I recognized, is: of course drawing Images is much faster, than imagelines (beacuse of VBOs), but also: I cannot pre-put vertex-data into a VBO for imageLines, because imageLines have no static shape like normal images (varying linelength, varying linewidth and the vertex positions of x1,y1 and x2,y2 change too often) That's why I use a normal Floatbuffer, instead of a VBO. So my question is: What's the best way for managing images, and other 2D-graphics functions. For me it's some kind of important, that the user of the engine is able to draw as many images/2D graphics as possible, without loosing to much performance. You can find the functions for drawing images, imagelines, rects, quads, etc. here: https://github.com/Chrise55/LLama3D/blob/master/Llama3DLibrary/src/com/llama3d/object/graphics/image/ImageBase.java Here an example how it looks with many images (testing artificial neural networks), it works fine, but already little bit slow with that many images... :(

    Read the article

  • redirect web app results to own application

    - by vbNewbie
    Is it possible to redirect a web apps results to a second application? I cannot parse the html source. It contains the javascript functions that execute the queries but all the content is probably server side. I hope this makes sense. The owner has made the script available but I am not sure how this helps. Can I using .net call the site and redirect results perhaps to a file or database? the app accesses one of googles apis and performs searches/queries and returns results which are displayed on the site. Now all the javascript functions that perform these queries are listed in the source but I do not know javascript so it does not make much sense to me. I have used the documentation which uses the oauth protocol to access the api and have implemented that in my web app but it took me nearly a week to get the request token right and now to send requests to the api, sometimes I get one result back and sometimes none. It is frustrating me and the owner of the web app has given use of his script but he says all that happens is that my browser interacts with the google api and not his server. So I thought why not have my web app call his, since his interacts with the API flawlessly and have the results sent to my app to save in a database. I have very little experience here so pardon my ignorance

    Read the article

  • Creating own shortcuts: Problem in safari

    - by Thariama
    I have a web application which needs to be called from firefox and safari. Several shortcuts will let the user edit stuff and do other actions. I already implemented my shortcuts and they work great in firefox but not in safari. I can't for example do anything on alt+return - its not getting catched. Is there an easy way to overwrite built-in shortcuts in safari? A way to make alt+return work with safari?

    Read the article

  • Initializing own plugins

    - by jgauffin
    I've written a few jquery plugins for my client. I want to write a function which would initialize each plugin which have been loaded. Example: <script src="/Scripts/jquery.plugin1.min.js")" type="text/javascript"></script> <script src="/Scripts/jquery.plugin2.min.js")" type="text/javascript"></script> <script src="/Scripts/jquery.initializer.min.js")" type="text/javascript"></script> Here I've loaded plugin1 and plugin2. Plugin1 should be attached to all links with class name 'ajax' and plugin2 to all divs with class name 'test2': $('document').ready(function(){ $('a.ajax').plugin1(); $('div.test2').plugin2(); } I know that I can use jQuery().pluginName to check if a plugin exists. But I want to have a leaner way. Can all loaded plugins register a initialize function in an array or something like that which I in document.ready can iterate through and invoke? like: //in plugin1.js myCustomPlugins['plugin1'] = function() { $('a.ajax').plugin1(); }; // and in the initializer script: myCustomPlugins.each(function() { this(); }; Guess it all boiled down to three questions: How do I use a jquery "global" array? How do I iterate through that array to invoke registered methods Are there a better approach?

    Read the article

  • Can't install APK hosted my own apache server

    - by Ogre_BGR
    I've exported an apk from eclipse. I am able to install it without any problem if I copy it to the phone's sd card. When trying to download via phone's (Galaxy S) browser I get: "Download unsuccessful". I have set mime type application/vnd.android.package-archive in the mime.types, restarted apache, still same result. Also tried : <a href="downloads/my_apk.apk" type="application/vnd.android.package-archive">Download App</a> Still no luck. I am able to download and install applications from android market. I suspect that apache is not sending the mime type but this is just a shot in the dark. How can I fix the problem and be able to install APKs from my web server? (or at least to check if apache sends correct header with mime type) Any help will be appreciated.

    Read the article

  • java.lang.NoClassDefFoundError thrown with my own packages in Android 1.5

    - by TiGer
    Hi, I have developed an application which has several packages within it's project... A class in one of those packages is called right away in the first line of code, which throws the dreaded java.lang.NoClassDefFoundError error... I don't get it, the package simply is within the project, and it works fine on my Android 1.6 device, but won't work with my 1.5 device... I do have to say that the project was originally set for 1.6, but then I changed the within the manifest from 4 to 3... Is that bad practice ? Or maybe it has nothing to do with the platform version ? Also I do get these lines as wel from the DDMS : 05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build; 05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: rejecting opcode 0x62 at 0x0034 05-04 17:24:59.921: WARN/dalvikvm(2041): VFY: rejected Lmobilaria/android/managementModule/Management;.getDeviceSpecifics ()V 05-04 17:24:59.921: WARN/dalvikvm(2041): Verifier rejected class Lmobilaria/android/managementModule/Management; Thats the ManagementModule which also tries to retrieve several info-fields of the device itself... Again, this works just fine on the 1.6 device, even though thats a development device whilst my 1.5 device is a non-development device...

    Read the article

  • Creating our own APIs

    - by Markii
    We need a bunch of APIs for our service and are looking at the job as being quite tedious for starting from scratch because we need strict user restrictions such as max queries and usage statistics. Are there any pre-made services or scripts for this already?

    Read the article

  • class function that generates its own objects

    - by honeybadger
    I want to write a class for some use. I want to call a function (say generate) of this class which will generate two objects of this same class. These two objects will call other function of the class. Can anyone tell me how to do this? I want it in C++ Class Example{ public: generate(); other_func(); } int main() { Example generate(); } Now this generate function should create two object of Example and will call other_func();

    Read the article

  • CMS or roll-yer-own?

    - by girlwithglasses
    I have a database of software tools and I want to be able to have users rate and comment on the tools, and view the ratings and comments that other users have left. To lower the risk of spammers attacking the site, I would like to be able to restrict comment/rating permissions to those who are logged in. At present, the tools are in a list on a static html page as part of a website that is very "non-interactive"; other than the contact form, there is nowhere that users contribute content to the site. We maintain a wiki (of the standard mediawiki flavour) that users can contribute to, and we also have a Drupal installation as a news site. Does anyone have any experience of creating such a rating/commenting system, and whether it would be better to use Mediawiki or Drupal (or another free CMS?), or to try to create something myself? Any advice would be appreciated. Thanks!

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >