Java Question HELP CREATE A LIBRARY

PABLO2013

Well-Known Member
Licensed User
Longtime User
CHEERS
I WANT TO KNOW YOU CAN BE WRONG IN THIS LIBRARY IF YOU CAN HELP ME , THANK YOU
 

Attachments

  • AHP.xml
    7.3 KB · Views: 292
  • AHP.jar
    4.1 KB · Views: 244
  • JAVA ERROR.PNG
    11.2 KB · Views: 243
  • PairwiseComparisonMatrix1.txt
    8.8 KB · Views: 240

Johan Schoeman

Expert
Licensed User
Longtime User
Your class name is not the same as your file name. Your class is called PairwiseComparisonMatrix while your file name is PairwiseComparisonMatrix1. Rename your file to PairwiseComparisonMatrix
 

DonManfred

Expert
Licensed User
Longtime User
You lib will not work on Android. Maybe on B4J it can run.

B4X:
import javax.swing.*;         
//This is the final package name.
//import com.sun.java.swing.*; //Used by JDK 1.2 Beta 4 and all
//Swing releases before Swing 1.1 Beta 3.
import javax.swing.border.*;

import java.awt.*;
import java.awt.event.*;

javaxy.swing and java.awt are NOT available on Android
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
tks Johan ,

still gives me this error ,tks

javac 1.8.0_71
src\b4a\example\main.java:345: error: cannot find symbol
public PairwiseComparisonMatrix _ahp = null;
^
symbol: class PairwiseComparisonMatrix
location: class main
Note: src\b4a\example\starter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
 

Johan Schoeman

Expert
Licensed User
Longtime User
There is an example here including the Java code
https://www.b4x.com/android/forum/threads/jama-a-java-matrix-package-b4a-wrapper-in-post-3.59192/
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
tks Johan , look please my proyect lib in zip format , tkstks
 

Attachments

  • ahhpp.zip
    11.1 KB · Views: 242

Johan Schoeman

Expert
Licensed User
Longtime User
tks Johan , look please my proyect lib in zip format , tkstks
Pablo, the attached project compiles:
1. Note the libs folder that I have added. Inside this folder is Jama-1.0.2.jar
2. You also need to have this jar (Jama-1.0.2.jar) inside your B4J additional library folder once you run your B4J project
3. I have not used eclipse but @Erel's Simple Library Compiler for B4J libraries. It is available on the forum to download. Just make sure you use the one that goes with B4J and not the one that goes with B4A (I don't use Eclipse at all - I only use Notepad++ and Simple Library Compiler for all my libraries).

 

Attachments

  • ahhpp.zip
    33.8 KB · Views: 252
  • PABLOLibFiles.zip
    5.4 KB · Views: 242

PABLO2013

Well-Known Member
Licensed User
Longtime User
Thanks for your time,
I do not explain much but the idea is that this library work in B4A and not B4J , similar to how you do it in your project jama (https://www.b4x.com/android/forum/threads/jama-a-java-matrix-package-b4a-wrapper-in-post-3.59192/) , help is to see how it should indicate the constructors , the initialization function and others to work in BA4, so far have been experimenting with javaobjet and could be a option, because my library is not very big , but I'm interested to see how it can be implemented in a additional library to see and grab practice .... the part of the library has in "swing"..... because the original code was so , but as I repeat myself interested in BA4.
You 're right, the library compiles (in this part only my knowledge) and do not know how to connect and work this with BA4.

thanks
 

DonManfred

Expert
Licensed User
Longtime User

PABLO2013

Well-Known Member
Licensed User
Longtime User
Don Mafred, you are right, what happens is that I copy bad code and copy with calls to "swing" but the idea is that i can use in B4A, the code works well on the console Eclipe , but this just use it to check the code..... by dispersing in how to use it in B4A , but my problem is not how to do it .... so I appeal to your kind work , tks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…